Skip to content

Instantly share code, notes, and snippets.

@kristofer84
Created December 4, 2023 13:57
Show Gist options
  • Save kristofer84/5a4320c5751e44b7fded39a617d619cc to your computer and use it in GitHub Desktop.
Save kristofer84/5a4320c5751e44b7fded39a617d619cc to your computer and use it in GitHub Desktop.
Create files needed for signing and verifying JWT
# npm install -g eckles
openssl ecparam -genkey -name prime256v1 -out private_key.pem
openssl ec -in private_key.pem -pubout -out public_key.pem
eckles public_key.pem > public_key.jwk
openssl req -x509 -key private_key.pem -subj /CN=localhost -days 1000 > certificate.pem
echo $(openssl x509 -in certificate.pem -fingerprint -noout) | sed 's/SHA1 Fingerprint=//g' | sed 's/://g' | xxd -r -ps | base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment