Skip to content

Commit 191d6a3

Browse files
author
DataGhost
committed
Added possibility to call jwk.construct() with a private key
1 parent 96474ec commit 191d6a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jose/backends/cryptography_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ def __init__(self, key, algorithm, cryptography_backend=default_backend):
243243

244244
self.cryptography_backend = cryptography_backend
245245

246-
# if it conforms to RSAPublicKey interface
247-
if hasattr(key, "public_bytes") and hasattr(key, "public_numbers"):
246+
# if it conforms to RSAPublicKey or RSAPrivateKey interface
247+
if (hasattr(key, "public_bytes") and hasattr(key, "public_numbers")) or hasattr(key, "private_bytes"):
248248
self.prepared_key = key
249249
return
250250

0 commit comments

Comments
 (0)