Skip to content

Instantly share code, notes, and snippets.

@Sceat
Created November 28, 2023 23:20
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 Sceat/e30da512257504087e2a240aed6471d4 to your computer and use it in GitHub Desktop.
Save Sceat/e30da512257504087e2a240aed6471d4 to your computer and use it in GitHub Desktop.
generate ES512 and RS256 elliptic curve keypairs for JWT JWK (JSON Web Token JSON Web Key) using openssl
# RS256
# private key
openssl genrsa -out rs256-4096-private.rsa 4096
# public key
openssl rsa -in rs256-4096-private.rsa -pubout > rs256-4096-public.pem
# ES512
# private key
openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem
# public key
openssl ec -in ecdsa-p521-private.pem -pubout -out ecdsa-p521-public.pem
@Sceat
Copy link
Author

Sceat commented Nov 28, 2023

u got us dirty max :(

image

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