change to sub-interface idea
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py
index e827271..682a36d 100644
--- a/cryptography/hazmat/primitives/interfaces.py
+++ b/cryptography/hazmat/primitives/interfaces.py
@@ -205,6 +205,14 @@
@six.add_metaclass(abc.ABCMeta)
+class RSAPrivateKeyWithNumbers(RSAPrivateKey):
+ def private_numbers(self):
+ """
+ Returns an RSAPrivateNumbers.
+ """
+
+
+@six.add_metaclass(abc.ABCMeta)
class RSAPublicKey(object):
@abc.abstractmethod
def verifier(self, signature, padding, algorithm, backend):
@@ -220,6 +228,14 @@
@six.add_metaclass(abc.ABCMeta)
+class RSAPublicKeyWithNumbers(RSAPublicKey):
+ def public_numbers(self):
+ """
+ Returns an RSAPublicNumbers
+ """
+
+
+@six.add_metaclass(abc.ABCMeta)
class DSAParameters(object):
@abc.abstractproperty
def modulus(self):
@@ -455,19 +471,3 @@
"""
The EllipticCurve that this key is on.
"""
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RSAPrivateNumbersAvailable(object):
- def private_numbers(self):
- """
- Returns an RSAPrivateNumbers.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RSAPublicNumbersAvailable(object):
- def public_numbers(self):
- """
- Returns an RSAPublicNumbers
- """
diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst
index 677199c..8e6c254 100644
--- a/docs/hazmat/primitives/interfaces.rst
+++ b/docs/hazmat/primitives/interfaces.rst
@@ -163,6 +163,22 @@
The bit length of the modulus.
+.. class:: RSAPrivateKeyWithNumbers
+
+ .. versionadded:: 0.5
+
+ Extends :class:`RSAPrivateKey`.
+
+ .. method:: private_numbers()
+
+ Create a
+ :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers`
+ object.
+
+ :returns: An
+ :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers`
+ instance.
+
.. class:: RSAPublicKey
@@ -219,6 +235,23 @@
The bit length of the modulus.
+.. class:: RSAPublicKeyWithNumbers
+
+ .. versionadded:: 0.5
+
+ Extends :class:`RSAPublicKey`.
+
+ .. method:: public_numbers()
+
+ Create a
+ :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers`
+ object.
+
+ :returns: An
+ :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers`
+ instance.
+
+
.. class:: DSAParameters
.. versionadded:: 0.3
@@ -492,39 +525,6 @@
.. attribute:: name
-Raw Numbers
-~~~~~~~~~~~
-
-.. class:: RSAPrivateNumbersAvailable
-
- .. versionadded:: 0.5
-
- .. method:: private_numbers()
-
- Create a
- :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers`
- object.
-
- :returns: An
- :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers`
- instance.
-
-
-.. class:: RSAPublicNumbersAvailable
-
- .. versionadded:: 0.5
-
- .. method:: public_numbers()
-
- Create a
- :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers`
- object.
-
- :returns: An
- :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers`
- instance.
-
-
Hash algorithms
~~~~~~~~~~~~~~~