-
Notifications
You must be signed in to change notification settings - Fork 238
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
jwk.construct() does not support reading a private RSA key #50
Comments
I guess I could try to construct my own |
Currently python-jose only parses public keys via jwk spec, eg. by passing in a dictionary. You should pass in PEM string and a private key will be constructed. |
Yeah, but when I have the key set already in JWK format, it requires a lot of jumping through hoops to get the PEM string. It was easier in my case to just construct a new |
I could try whipping up a quick PR if this is something that you think python-jose should be doing |
I definitely think that python-jose should be able to handle private keys in the JWK format, that work just hasn't been an issue up to this point. I would welcome a PR that included that work. |
+1 this feature, running into this issue as well @mpdavis |
Attempting to sign a JWT token with a private RSA key throws:
The problem seems to come from
RSAKey._process_jwk()
injwk.py
:Note that the
d
,p
,q
fields in the JWK representation are ignored, but given the description inRSA.py
(frompycrypto
), these are the very values that are needed to construct a private key.The text was updated successfully, but these errors were encountered: