Last active
June 5, 2021 17:25
-
-
Save WarFox/4d50629e49b437298b499e3d921c5bb0 to your computer and use it in GitHub Desktop.
Generate RS256 key pair for asymmetric jwt signing
This file contains hidden or 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
openssl genrsa -out jwt-private.pem 2048 | |
openssl rsa -in jwt-private.pem -pubout -out jwt-public.pem |
This file contains hidden or 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
# Put the private key in aws secrets manager | |
aws secretsmanager create-secret --name my-secret-name --secret-string (base64 jwt-private.pem) |
This file contains hidden or 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
# Put the public key in S3 bucket | |
aws s3 cp jwt-public.pem s3://my-public-key-bucket/jwt-public.pem |
This file contains hidden or 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
aws secretsmanager get-secret-value --secret-id my-secret-name --query 'SecretString' --output text | base64 -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment