-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding JWT with ES256 and secp256k1 curve #277
Labels
Comments
Hi @ivanovaleksey, thanks for the detailed report. The JWA specs allow the following algos for the signature: (source)
IMHO, we shouldn't add/support algos that aren't listed. |
Hi @excpt, thank you for the reply and for the information. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, thank you for the great library!
I have very poor knowledge in cryptography and after receiving an error while decoding a JWT I decided to take advice with someone.
I use JWT with ES256 algorithm. I generated key pair with commands
As you can see I use
secp256k1
curve.Yesterday I tried to decode a JWT signed with
es/private_key.pem
.I tried the following code:
And I got an error
I looked though the code and found that to work with ES256
prime256v1
curve should be used.So, right now and can't decode JWTs with the library.
My question is:
Is it really wrong to use
secp256k1
(in that case I should specifyprime256v1
while generating key pair) or we can update the library by adding'prime256v1' => 'ES256'
toNAMED_CURVES
)?The text was updated successfully, but these errors were encountered: