Skip to content

Instantly share code, notes, and snippets.

@kyungmi
Forked from ygotthilf/jwtRS256.sh
Last active November 21, 2018 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyungmi/d8f5c01c365416f8b6f4106cd6a5ac3d to your computer and use it in GitHub Desktop.
Save kyungmi/d8f5c01c365416f8b6f4106cd6a5ac3d to your computer and use it in GitHub Desktop.
How to generate JWT RS256 key
#!/bin/sh
KEY_FILE_NAME=$1
KEY_LENGTH=${2:-4096}
ssh-keygen -t rsa -m PEM -b ${KEY_LENGTH} -f ${KEY_FILE_NAME}.key -C ""
openssl rsa -in ${KEY_FILE_NAME}.key -pubout -outform PEM -out ${KEY_FILE_NAME}.key.pub
cat ${KEY_FILE_NAME}.key
cat ${KEY_FILE_NAME}.key.pub
@kyungmi
Copy link
Author

kyungmi commented Oct 17, 2018

./keygen.sh key_file_name 4096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment