Last active
February 9, 2022 01:30
-
-
Save xros/784dc6029a05a572e08f76a19cacd5ab to your computer and use it in GitHub Desktop.
generate JWT RSA256 key pair using openssl
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
# This RSA256 key is of 2048 bits long (valid between 1024-4096) | |
openssl genrsa -out jwtRSA256.private.key 2048 | |
openssl rsa -in jwtRSA256.private.key -pubout -out jwtRSA256.public.key | |
# no need to input passphrase | |
cat jwtRSA256.private.key | |
cat jwtRSA256.public.key | |
# notice the jwtRSA256.public.key is in ssh-rsa format |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTICE for PEM public key
For generating
PEM
public key, use this-outform PEM
openssl rsa -in jwtRSA256.private.key -outform PEM -pubout -out jwtRSA256.public.key