Skip to content

Instantly share code, notes, and snippets.

@ivarkol
Created October 25, 2020 13:08
Show Gist options
  • Save ivarkol/32efe72e8bbf83bb88b58990b65df9ad to your computer and use it in GitHub Desktop.
Save ivarkol/32efe72e8bbf83bb88b58990b65df9ad to your computer and use it in GitHub Desktop.
Generate key pair with openssl
openssl genrsa -out keypair.pem 2048
To extract the public part, use the rsa context:
openssl rsa -in keypair.pem -pubout -out publickey.crt
Finally, convert the original keypair to PKCS#8 format with the pkcs8 context:
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out pkcs8.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment