From 592707bb97cb8e36220b5dfcb53a7c1a8a91d998 Mon Sep 17 00:00:00 2001 From: Hasier Date: Tue, 5 Jul 2022 11:11:54 +0100 Subject: [PATCH] Fix cryptography WithSerialization aliases Align with changes in https://github.com/pyca/cryptography/commit/6a8c0b55b99f95e1fcc8bb9c2b03fd9158d2081e --- .../cryptography/hazmat/primitives/asymmetric/dsa.pyi | 4 ++-- .../cryptography/hazmat/primitives/asymmetric/ec.pyi | 4 ++-- .../cryptography/hazmat/primitives/asymmetric/rsa.pyi | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi b/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi index 364376cc6743..cfebbbd5abd4 100644 --- a/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi +++ b/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi @@ -34,8 +34,6 @@ class DSAPrivateKey(metaclass=ABCMeta): def public_key(self) -> DSAPublicKey: ... @abstractmethod def sign(self, data: bytes, algorithm: HashAlgorithm | Prehashed) -> bytes: ... - -class DSAPrivateKeyWithSerialization(DSAPrivateKey): @abstractmethod def private_bytes( self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption @@ -43,6 +41,8 @@ class DSAPrivateKeyWithSerialization(DSAPrivateKey): @abstractmethod def private_numbers(self) -> DSAPrivateNumbers: ... +DSAPrivateKeyWithSerialization = DSAPrivateKey + class DSAPrivateNumbers: @property def x(self) -> int: ... diff --git a/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi b/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi index fb6e7457e8d4..cd3782a9cca6 100644 --- a/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi +++ b/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi @@ -127,8 +127,6 @@ class EllipticCurvePrivateKey(metaclass=ABCMeta): def public_key(self) -> EllipticCurvePublicKey: ... @abstractmethod def sign(self, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> bytes: ... - -class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey): @abstractmethod def private_bytes( self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption @@ -136,6 +134,8 @@ class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey): @abstractmethod def private_numbers(self) -> EllipticCurvePrivateNumbers: ... +EllipticCurvePrivateKeyWithSerialization = EllipticCurvePrivateKey + class EllipticCurvePrivateNumbers: @property def private_value(self) -> int: ... diff --git a/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi b/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi index 2fe8886d2598..ba74f7ddbe09 100644 --- a/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi +++ b/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi @@ -17,8 +17,6 @@ class RSAPrivateKey(metaclass=ABCMeta): def public_key(self) -> RSAPublicKey: ... @abstractmethod def sign(self, data: bytes, padding: AsymmetricPadding, algorithm: HashAlgorithm | Prehashed) -> bytes: ... - -class RSAPrivateKeyWithSerialization(RSAPrivateKey): @abstractmethod def private_bytes( self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption @@ -26,6 +24,8 @@ class RSAPrivateKeyWithSerialization(RSAPrivateKey): @abstractmethod def private_numbers(self) -> RSAPrivateNumbers: ... +RSAPrivateKeyWithSerialization = RSAPrivateKey + class RSAPublicKey(metaclass=ABCMeta): @property @abstractmethod