-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Milestone
Description
Private keys (at least RSAPrivateKey) can not be copied in cryptography 43.0.3:
>>> import copy
>>> from cryptography.hazmat.primitives.asymmetric import rsa
>>> private_key = rsa.generate_private_key(
... public_exponent=65537,
... key_size=2048,
... )
>>> copied_key = copy.copy(private_key)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jocke/.pyenv/versions/3.11.7/lib/python3.11/copy.py", line 92, in copy
rv = reductor(4)
^^^^^^^^^^^
TypeError: cannot pickle 'cryptography.hazmat.bindings._rust.openssl.rsa.RSAPrivateKey' object
There was a similar issue for public keys reported in #9403 and it seems like the fix to that issue only made it possible to copy all the public keys, not any of the private ones.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels