Created
August 20, 2016 15:06
-
-
Save steinfletcher/fdd88551f2cc7a0f78c6bcd2d3d2af95 to your computer and use it in GitHub Desktop.
Generate public and private key pair
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# generate a 2048-bit RSA private key | |
openssl genrsa -out private_tmp_key.pem 2048 | |
# convert private Key to PKCS#8 format (so Java can read it) | |
openssl pkcs8 -topk8 -inform PEM -in private_tmp_key.pem -out private_key.pem -nocrypt | |
# generate a public key from the private one | |
openssl rsa -pubout -in private_tmp_key.pem -out public_key.pem | |
# cleanup | |
rm private_tmp_key.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment