Skip to content

Commit 76e5dee

Browse files
Fix keyvault compatibility with cryptography 47.0.0
- Add __deepcopy__ to KeyVaultRSAPublicKey and KeyVaultRSAPrivateKey to satisfy new abstract method added in cryptography 47.0.0 - Pin cryptography<47.0.0 in certificates dev_requirements.txt to avoid broken PyPy 3.11 wheel served by CI feed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c560852 commit 76e5dee

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

sdk/keyvault/azure-keyvault-certificates/dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ aiohttp>=3.0
66
parameterized>=0.7.3
77
python-dateutil>=2.8.0
88
pyopenssl
9-
cryptography>=44.0.2
9+
cryptography<47.0.0

sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_models.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,16 @@ def __copy__(self) -> KeyVaultRSAPublicKey:
317317
"""
318318
return self
319319

320-
def verifier( # pylint:disable=docstring-missing-param,docstring-missing-return,docstring-missing-rtype
320+
def __deepcopy__(self, memo: dict) -> KeyVaultRSAPublicKey:
321+
"""Returns this instance since it is treated as immutable.
322+
323+
:param dict memo: The memo dictionary used by deepcopy.
324+
:returns: This instance.
325+
:rtype: ~azure.keyvault.keys.crypto.KeyVaultRSAPublicKey
326+
"""
327+
return self
328+
329+
def verifier(# pylint:disable=docstring-missing-param,docstring-missing-return,docstring-missing-rtype
321330
self, signature: bytes, padding: AsymmetricPadding, algorithm: HashAlgorithm
322331
) -> NoReturn:
323332
"""Not implemented. This method was deprecated in `cryptography` 2.0 and removed in 37.0.0."""
@@ -499,6 +508,15 @@ def __copy__(self) -> KeyVaultRSAPrivateKey:
499508
"""
500509
return self
501510

511+
def __deepcopy__(self, memo: dict) -> KeyVaultRSAPrivateKey:
512+
"""Returns this instance since it is treated as immutable.
513+
514+
:param dict memo: The memo dictionary used by deepcopy.
515+
:returns: This instance.
516+
:rtype: ~azure.keyvault.keys.crypto.KeyVaultRSAPrivateKey
517+
"""
518+
return self
519+
502520

503521
class DecryptResult:
504522
"""The result of a decrypt operation.

0 commit comments

Comments
 (0)