Skip to content

Instantly share code, notes, and snippets.

@ddpruitt
Forked from ygotthilf/jwtRS256.sh
Last active May 11, 2022 19:36
Show Gist options
  • Save ddpruitt/79c002f4ca4970d200b697a96d570ab6 to your computer and use it in GitHub Desktop.
Save ddpruitt/79c002f4ca4970d200b697a96d570ab6 to your computer and use it in GitHub Desktop.
How to generate JWT RS256 key
#
# From "How to generate a JWT RS256 key" Gist <https://gist.github.com/ygotthilf/baa58da5c3dd1f69fae9>
#
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# NOTE: Don't add a passphrase when prompted:
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
#
# On Windows use the openssl.exe in the git usr\bin folder.
# C:\Users\USERNAME\AppData\Local\Programs\Git\usr\bin\openssl
#
# It is also possible to just do it with ssh-keygen (https://gist.github.com/ygotthilf/baa58da5c3dd1f69fae9#gistcomment-2855422)
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
ssh-keygen -e -m PEM -f jwtRS256.key > jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment