skeeto/passphrase2pgp

feature request: generate self-signed certificate

Closed this issue · 3 comments

Subject says it all. Currently I can generate gpg key from passphrase to do signing/encryption, ssh key to authenticate to ssh server. I also have self-signed certificate that I use to authenticate myself to some web services. Would it be possible to generate SSL certificate from passphrase too?

Thank you for your work "passphrase2pgp" and "enchive". It already saved me a lot of time.

Well, I am not expert either, but here is what I do:

  1. Generate certificate with following incantation:
openssl req -nodes -x509 -newkey ed25519 \
        -keyout secret.key -out public.pem -days 3650 \
        -config /etc/ssl/openssl.cnf
  1. Configure nginx to validate certificate with following lines:
   ssl_verify_client optional;
   ssl_client_certificate  ${trusted};
    location / {
           if ($ssl_client_verify != SUCCESS) {
              return 401;
     }

I put into "trusted" concatenation of trusted certificates, essentially re-implementing ssh over ssl.

  1. Now you receive 401 to all requests unless you specify certificate with "curl -E public.pem --key secret.key".

As for meta-data, it would be enough for my needs to only fill-in email and name, exactly what we have on gpg key.