diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-07-04 12:46:50 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-07-04 12:46:50 -0500 |
commit | 15a1b59e9c4bb8f5e450cb619d5885b948b10aee (patch) | |
tree | f2cb3ccaa22e6ddb8265a89a1d694f6dad62ff6e | |
parent | 947941410c1af61d63dc2d96cb7c5e36c4119da6 (diff) | |
download | cryptography-15a1b59e9c4bb8f5e450cb619d5885b948b10aee.tar.gz cryptography-15a1b59e9c4bb8f5e450cb619d5885b948b10aee.tar.bz2 cryptography-15a1b59e9c4bb8f5e450cb619d5885b948b10aee.zip |
move PublicKeyWithSerialization methods to PublicKey
-rw-r--r-- | docs/hazmat/primitives/asymmetric/dsa.rst | 14 | ||||
-rw-r--r-- | docs/hazmat/primitives/asymmetric/ec.rst | 14 | ||||
-rw-r--r-- | docs/hazmat/primitives/asymmetric/rsa.rst | 14 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/dsa.py | 6 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/ec.py | 6 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/rsa.py | 6 |
6 files changed, 30 insertions, 30 deletions
diff --git a/docs/hazmat/primitives/asymmetric/dsa.rst b/docs/hazmat/primitives/asymmetric/dsa.rst index e16974d5..d60fd882 100644 --- a/docs/hazmat/primitives/asymmetric/dsa.rst +++ b/docs/hazmat/primitives/asymmetric/dsa.rst @@ -367,13 +367,6 @@ Key interfaces :returns: :class:`~cryptography.hazmat.primitives.asymmetric.AsymmetricVerificationContext` - -.. class:: DSAPublicKeyWithSerialization - - .. versionadded:: 0.8 - - Extends :class:`DSAPublicKey`. - .. method:: public_numbers() Create a @@ -402,6 +395,13 @@ Key interfaces :return bytes: Serialized key. +.. class:: DSAPublicKeyWithSerialization + + .. versionadded:: 0.8 + + Alias of :class:`DSAPublicKey`. + + .. _`DSA`: https://en.wikipedia.org/wiki/Digital_Signature_Algorithm .. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography .. _`FIPS 186-4`: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst index daec5df3..4569f6d4 100644 --- a/docs/hazmat/primitives/asymmetric/ec.rst +++ b/docs/hazmat/primitives/asymmetric/ec.rst @@ -386,13 +386,6 @@ Key Interfaces The elliptic curve for this key. - -.. class:: EllipticCurvePublicKeyWithSerialization - - .. versionadded:: 0.6 - - Extends :class:`EllipticCurvePublicKey`. - .. method:: public_numbers() Create a :class:`EllipticCurvePublicNumbers` object. @@ -417,6 +410,13 @@ Key Interfaces :return bytes: Serialized key. +.. class:: EllipticCurvePublicKeyWithSerialization + + .. versionadded:: 0.6 + + Alias of :class:`EllipticCurvePublicKey`. + + .. _`FIPS 186-3`: http://csrc.nist.gov/publications/fips/fips186-3/fips_186-3.pdf .. _`FIPS 186-4`: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf .. _`some concern`: https://crypto.stackexchange.com/questions/10263/should-we-trust-the-nist-recommended-ecc-parameters diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 8689bad3..ed7f66b2 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -608,13 +608,6 @@ Key interfaces The bit length of the modulus. - -.. class:: RSAPublicKeyWithSerialization - - .. versionadded:: 0.8 - - Extends :class:`RSAPublicKey`. - .. method:: public_numbers() Create a @@ -645,6 +638,13 @@ Key interfaces :return bytes: Serialized key. +.. class:: RSAPublicKeyWithSerialization + + .. versionadded:: 0.8 + + Alias of :class:`RSAPublicKey`. + + .. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem) .. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography .. _`specific mathematical properties`: https://en.wikipedia.org/wiki/RSA_(cryptosystem)#Key_generation diff --git a/src/cryptography/hazmat/primitives/asymmetric/dsa.py b/src/cryptography/hazmat/primitives/asymmetric/dsa.py index 733a967c..184177e0 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/dsa.py +++ b/src/cryptography/hazmat/primitives/asymmetric/dsa.py @@ -91,9 +91,6 @@ class DSAPublicKey(object): Returns an AsymmetricVerificationContext used for signing data. """ - -@six.add_metaclass(abc.ABCMeta) -class DSAPublicKeyWithSerialization(DSAPublicKey): @abc.abstractmethod def public_numbers(self): """ @@ -107,6 +104,9 @@ class DSAPublicKeyWithSerialization(DSAPublicKey): """ +DSAPublicKeyWithSerialization = DSAPublicKey + + def generate_parameters(key_size, backend): return backend.generate_dsa_parameters(key_size) diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py index 631fcbf7..f1d39eed 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/ec.py +++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py @@ -85,9 +85,6 @@ class EllipticCurvePublicKey(object): The EllipticCurve that this key is on. """ - -@six.add_metaclass(abc.ABCMeta) -class EllipticCurvePublicKeyWithSerialization(EllipticCurvePublicKey): @abc.abstractmethod def public_numbers(self): """ @@ -101,6 +98,9 @@ class EllipticCurvePublicKeyWithSerialization(EllipticCurvePublicKey): """ +EllipticCurvePublicKeyWithSerialization = EllipticCurvePublicKey + + @utils.register_interface(EllipticCurve) class SECT571R1(object): name = "sect571r1" diff --git a/src/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py index 772473fd..89eac4d4 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py +++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py @@ -76,9 +76,6 @@ class RSAPublicKey(object): The bit length of the public modulus. """ - -@six.add_metaclass(abc.ABCMeta) -class RSAPublicKeyWithSerialization(RSAPublicKey): @abc.abstractmethod def public_numbers(self): """ @@ -92,6 +89,9 @@ class RSAPublicKeyWithSerialization(RSAPublicKey): """ +RSAPublicKeyWithSerialization = RSAPublicKey + + def generate_private_key(public_exponent, key_size, backend): if not isinstance(backend, RSABackend): raise UnsupportedAlgorithm( |