Skip to content

Instantly share code, notes, and snippets.

@alnaranjo
Last active October 24, 2023 15:29
Show Gist options
  • Save alnaranjo/08aa9d9927db6b72ebe4775f31117a36 to your computer and use it in GitHub Desktop.
Save alnaranjo/08aa9d9927db6b72ebe4775f31117a36 to your computer and use it in GitHub Desktop.
JWT Private/Public Key Generation
# 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