Skip to content

Instantly share code, notes, and snippets.

@help-14
Last active September 15, 2022 02:43
Show Gist options
  • Save help-14/db3bcfe02ba4414845638bcfc8ee99e9 to your computer and use it in GitHub Desktop.
Save help-14/db3bcfe02ba4414845638bcfc8ee99e9 to your computer and use it in GitHub Desktop.
RSA cheatsheet
# generate a private key with the correct length
openssl genrsa -out private-key.pem 2048
# generate corresponding public key
openssl rsa -in private-key.pem -pubout -out public-key.pem
# optional: create a self-signed certificate
openssl req -new -x509 -key private-key.pem -out cert.pem -days 360
# optional: convert pem to pfx
openssl pkcs12 -export -inkey private-key.pem -in cert.pem -out cert.pfx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment