Skip to content

Support for JWT verification without x5c. #271

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

Closed
bburli opened this issue Dec 4, 2022 · 8 comments · Fixed by #307
Closed

Support for JWT verification without x5c. #271

bburli opened this issue Dec 4, 2022 · 8 comments · Fixed by #307
Labels

Comments

@bburli
Copy link

bburli commented Dec 4, 2022

I have a use case where jwk doesn't have x5c but only e and n for RSA256. I noticed that it's not possible to only pass e and n to the library and get the jwt verified.

  1. Does the library assume that we use OpenSSL methods to create RSA key with e and n and then user it for verification or am I missing something?
  2. I did try that and I keep getting error:04067072: rsa routines:r sa_ossl_public_decrypt: padding check failed. I am far from an OpenSSL expert but I tried using all padding methods and none works. How do I know the padding method used in signature?

Thanks in advance.

@bburli bburli changed the title Support for JWT verification with x5c. Support for JWT verification without x5c. Dec 4, 2022
@prince-chrismc
Copy link
Collaborator

Currently you need to calculate the public key from the modulus and exponent and use that.

#160 (comment) Should give you a good start.

Of course if you be interested in adding a function to the library with an example I would be very willing to help get the PR in merged.

It's a common feature request and would be a great contribution 👍

@bburli
Copy link
Author

bburli commented Dec 5, 2022

@prince-chrismc Thank you. I would be very willing. I will get back to you.

@dr0pdb
Copy link

dr0pdb commented Aug 10, 2023

I ended up implementing JWK JSON to PEM conversion for RSA and EC keys in this function in YugabyteDB. Hopefully it is useful.

@prince-chrismc
Copy link
Collaborator

Thanks ! There's some interesting bits

@bburli
Copy link
Author

bburli commented Aug 10, 2023

@prince-chrismc Oh my! I totally missed that I had wanted to do this! My apologies. Is it done or can I take it up? I do intend to do this and there is enough to go on thanks to you and @dr0pdb.

@bburli
Copy link
Author

bburli commented Aug 10, 2023

NM, I saw the linked PR just now :(

@prince-chrismc
Copy link
Collaborator

The current PR is failing so you are more then welcome to open a a new one!

@bburli
Copy link
Author

bburli commented Aug 16, 2023

@prince-chrismc Sure, will give it a shot. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants