Open
Description
Attempting to sign a JWT token with a private RSA key throws:
JWKError: Private key not available in this object
The problem seems to come from RSAKey._process_jwk()
in jwk.py
:
def _process_jwk(self, jwk_dict):
if not jwk_dict.get('kty') == 'RSA':
raise JWKError("Incorrect key type. Expected: 'RSA', Recieved: %s" % jwk_dict.get('kty'))
e = base64_to_long(jwk_dict.get('e', 256))
n = base64_to_long(jwk_dict.get('n'))
self.prepared_key = RSA.construct((n, e))
return self.prepared_key
Note that the d
, p
, q
fields in the JWK representation are ignored, but given the description in RSA.py
(from pycrypto
), these are the very values that are needed to construct a private key.
Metadata
Metadata
Assignees
Labels
No labels