diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-09-24 11:26:48 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-09-27 09:42:03 -0500 |
commit | e025be284e1a1d19e761b0fff907d126f17b4fb0 (patch) | |
tree | 4f9b96a5ad59b91fc965568aae363058a2c4ab94 | |
parent | 45d4c5909bd857986b901d59fd4d77bce63bfeff (diff) | |
download | cryptography-e025be284e1a1d19e761b0fff907d126f17b4fb0.tar.gz cryptography-e025be284e1a1d19e761b0fff907d126f17b4fb0.tar.bz2 cryptography-e025be284e1a1d19e761b0fff907d126f17b4fb0.zip |
add EC WithNumbers interfaces and docs
-rw-r--r-- | cryptography/hazmat/primitives/interfaces.py | 18 | ||||
-rw-r--r-- | docs/hazmat/primitives/interfaces.rst | 34 |
2 files changed, 52 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index d60f9e0e..c7ad0cf8 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -444,6 +444,15 @@ class EllipticCurvePrivateKey(object): @six.add_metaclass(abc.ABCMeta) +class EllipticCurvePrivateKeyWithNumbers(EllipticCurvePrivateKey): + @abc.abstractmethod + def private_numbers(self): + """ + Returns an EllipticCurvePrivateNumbers. + """ + + +@six.add_metaclass(abc.ABCMeta) class EllipticCurvePublicKey(object): @abc.abstractmethod def verifier(self, signature, signature_algorithm): @@ -456,3 +465,12 @@ class EllipticCurvePublicKey(object): """ The EllipticCurve that this key is on. """ + + +@six.add_metaclass(abc.ABCMeta) +class EllipticCurvePublicKeyWithNumbers(EllipticCurvePublicKey): + @abc.abstractmethod + def public_numbers(self): + """ + Returns an EllipticCurvePublicNumbers. + """ diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index ac47c1e1..14be6982 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -492,6 +492,23 @@ Elliptic Curve The EllipticCurvePublicKey object for this private key. +.. class:: EllipticCurvePrivateKeyWithNumbers + + .. versionadded:: 0.6 + + Extends :class:`EllipticCurvePrivateKey`. + + .. method:: private_numbers() + + Create a + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateNumbers` + object. + + :returns: An + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateNumbers` + instance. + + .. class:: EllipticCurvePublicKey .. versionadded:: 0.5 @@ -518,6 +535,23 @@ Elliptic Curve The elliptic curve for this key. +.. class:: EllipticCurvePublicKeyWithNumbers + + .. versionadded:: 0.6 + + Extends :class:`EllipticCurvePublicKey`. + + .. method:: private_numbers() + + Create a + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicNumbers` + object. + + :returns: An + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicNumbers` + instance. + + Hash algorithms --------------- |