diff options
-rw-r--r-- | cryptography/hazmat/primitives/interfaces.py | 16 | ||||
-rw-r--r-- | docs/hazmat/primitives/interfaces.rst | 34 |
2 files changed, 50 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index d805bd1a..8e0dd873 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -455,3 +455,19 @@ class EllipticCurvePublicKey(object): """ The EllipticCurve that this key is on. """ + + +@six.add_metaclass(abc.ABCMeta) +class RSAPrivateNumbersSerialization(object): + def rsa_private_numbers(self): + """ + Returns an RSAPrivateNumbers. + """ + + +@six.add_metaclass(abc.ABCMeta) +class RSAPublicNumbersSerialization(object): + def rsa_public_numbers(self): + """ + Returns an RSAPublicNumbers + """ diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index d5ca59ab..c27782e4 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -491,6 +491,40 @@ Asymmetric interfaces .. attribute:: name + +Key Serialization +----------------- + +.. class:: RSAPrivateNumbersSerialziation + + .. versionadded:: 0.5 + + .. method:: rsa_private_numbers() + + Serialize to an + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers` + representation. + + :returns: An + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers` + instance. + + +.. class:: RSAPublicNumberSerialization + + .. versionadded:: 0.5 + + .. method:: rsa_public_numbers() + + Serialize to an + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers` + representation. + + :returns: An + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers` + instance. + + Hash algorithms ~~~~~~~~~~~~~~~ |