Skip to content

Instantly share code, notes, and snippets.

@sdesalas
Last active March 5, 2024 11:54
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 sdesalas/694c1a79f7110af387a1099c5bf39646 to your computer and use it in GitHub Desktop.
Save sdesalas/694c1a79f7110af387a1099c5bf39646 to your computer and use it in GitHub Desktop.
JWT ES256 and ECDS Key generation
# Generate JWT public/private key pair for use in JWT (ES256 algorithm)
openssl ecparam -name secp256r1 -genkey -out jwt.es256.priv
openssl ec -in jwt.es256.priv -pubout -outform PEM -out jwt.es256.pub
# Create PKCS8 format
openssl pkcs8 -topk8 -inform PEM -outform DER -in jwt.es256.priv -out jwt.es256.pkcs8 -nocrypt
base64 -i jwt.es256.pkcs8 > jwt.es256.pkcs8.base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment