Last active
October 24, 2023 15:29
-
-
Save alnaranjo/08aa9d9927db6b72ebe4775f31117a36 to your computer and use it in GitHub Desktop.
JWT Private/Public Key Generation
This file contains 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
# Generate PKCS#8 Keys | |
openssl genrsa -out keypair.pem 2048 | |
openssl rsa -in keypair.pem -pubout -out public.key | |
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out private.key | |
# Copy keys as single line | |
awk -v ORS='\\n' '1' public.key | pbcopy | |
awk -v ORS='\\n' '1' private.pub | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment