Skip to content

Instantly share code, notes, and snippets.

@WarFox
Last active June 5, 2021 17:25
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 WarFox/4d50629e49b437298b499e3d921c5bb0 to your computer and use it in GitHub Desktop.
Save WarFox/4d50629e49b437298b499e3d921c5bb0 to your computer and use it in GitHub Desktop.
Generate RS256 key pair for asymmetric jwt signing
openssl genrsa -out jwt-private.pem 2048
openssl rsa -in jwt-private.pem -pubout -out jwt-public.pem
# Put the private key in aws secrets manager
aws secretsmanager create-secret --name my-secret-name --secret-string (base64 jwt-private.pem)
# Put the public key in S3 bucket
aws s3 cp jwt-public.pem s3://my-public-key-bucket/jwt-public.pem
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