Skip to content

Instantly share code, notes, and snippets.

@isstaif
Last active December 28, 2015 04:59
Show Gist options
  • Save isstaif/7446843 to your computer and use it in GitHub Desktop.
Save isstaif/7446843 to your computer and use it in GitHub Desktop.
Generating a certificate using openssl
#generate private key
openssl genrsa -out private-key.pem 4096
#generate signing request
openssl req -new -key private-key.pem -out certificate-signing-request.pem
#self sign the request (or send off the Verisign etc etc)
openssl x509 -req -in certificate-signing-request.pem -signkey private-key.pem -out certificate.pem
#extract public key out of the certificate
openssl x509 -pubkey -noout -in certificate.pem > public-key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment