Merge pull request #2113 from reaperhulk/new-gn-types
add SAN ediPartyName and x400Address test vectors
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index a540e4a..82a3e5b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -152,23 +152,17 @@
* Added
:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKeyWithSerialization`
and deprecated ``RSAPublicKeyWithNumbers``.
-* Added
- :meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKeyWithSerialization.public_bytes`
- to
+* Added ``public_bytes`` to
:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKeyWithSerialization`.
* Added
:class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKeyWithSerialization`
and deprecated ``EllipticCurvePublicKeyWithNumbers``.
-* Added
- :meth:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKeyWithSerialization.public_bytes`
- to
+* Added ``public_bytes`` to
:class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKeyWithSerialization`.
* Added
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicKeyWithSerialization`
and deprecated ``DSAPublicKeyWithNumbers``.
-* Added
- :meth:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicKeyWithSerialization.public_bytes`
- to
+* Added ``public_bytes`` to
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicKeyWithSerialization`.
* :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm` and
:class:`~cryptography.hazmat.primitives.hashes.HashContext` were moved from
diff --git a/docs/hazmat/primitives/asymmetric/dsa.rst b/docs/hazmat/primitives/asymmetric/dsa.rst
index e16974d..2ceb7d7 100644
--- a/docs/hazmat/primitives/asymmetric/dsa.rst
+++ b/docs/hazmat/primitives/asymmetric/dsa.rst
@@ -367,13 +367,6 @@
:returns:
:class:`~cryptography.hazmat.primitives.asymmetric.AsymmetricVerificationContext`
-
-.. class:: DSAPublicKeyWithSerialization
-
- .. versionadded:: 0.8
-
- Extends :class:`DSAPublicKey`.
-
.. method:: public_numbers()
Create a
@@ -402,6 +395,13 @@
:return bytes: Serialized key.
+.. class:: DSAPublicKeyWithSerialization
+
+ .. versionadded:: 0.8
+
+ Alias for :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 daec5df..e0abe0a 100644
--- a/docs/hazmat/primitives/asymmetric/ec.rst
+++ b/docs/hazmat/primitives/asymmetric/ec.rst
@@ -386,13 +386,6 @@
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 @@
:return bytes: Serialized key.
+.. class:: EllipticCurvePublicKeyWithSerialization
+
+ .. versionadded:: 0.6
+
+ Alias for :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 8689bad..e8bbf5c 100644
--- a/docs/hazmat/primitives/asymmetric/rsa.rst
+++ b/docs/hazmat/primitives/asymmetric/rsa.rst
@@ -113,10 +113,8 @@
>>> pem.splitlines()[0]
'-----BEGIN RSA PRIVATE KEY-----'
-Similarly, if your public key implements
-:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKeyWithSerialization`
-interface you can use
-:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKeyWithSerialization.public_bytes`
+For public keys you can use
+:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey.public_bytes`
to serialize the key.
.. doctest::
@@ -608,13 +606,6 @@
The bit length of the modulus.
-
-.. class:: RSAPublicKeyWithSerialization
-
- .. versionadded:: 0.8
-
- Extends :class:`RSAPublicKey`.
-
.. method:: public_numbers()
Create a
@@ -645,6 +636,13 @@
:return bytes: Serialized key.
+.. class:: RSAPublicKeyWithSerialization
+
+ .. versionadded:: 0.8
+
+ Alias for :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 733a967..184177e 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/dsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/dsa.py
@@ -91,9 +91,6 @@
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 @@
"""
+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 631fcbf..f1d39ee 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -85,9 +85,6 @@
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 @@
"""
+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 772473f..89eac4d 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -76,9 +76,6 @@
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 @@
"""
+RSAPublicKeyWithSerialization = RSAPublicKey
+
+
def generate_private_key(public_exponent, key_size, backend):
if not isinstance(backend, RSABackend):
raise UnsupportedAlgorithm(