aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-05-31 17:13:59 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-05-31 17:13:59 -0500
commit3ebbd004cf8588a12007fbaa0572003673b54cdc (patch)
tree4704f794fb34759dbeadb3ed8390dcd5455b8064 /cryptography
parentd9488d06859da184eedf97f9021a45f3b708fe7b (diff)
parent13f1d8dfd7c216177c605341aa9a180ff813bd19 (diff)
downloadcryptography-3ebbd004cf8588a12007fbaa0572003673b54cdc.tar.gz
cryptography-3ebbd004cf8588a12007fbaa0572003673b54cdc.tar.bz2
cryptography-3ebbd004cf8588a12007fbaa0572003673b54cdc.zip
Merge pull request #1050 from public/ec-backend-interfaces
EllipticCurveBackend interfaces
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/backends/interfaces.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py
index 55d5cd78..ba02bbd2 100644
--- a/cryptography/hazmat/backends/interfaces.py
+++ b/cryptography/hazmat/backends/interfaces.py
@@ -218,3 +218,39 @@ class CMACBackend(object):
"""
Create a CMACContext for calculating a message authentication code.
"""
+
+
+@six.add_metaclass(abc.ABCMeta)
+class EllipticCurveBackend(object):
+ @abc.abstractmethod
+ def elliptic_curve_signature_algorithm_supported(
+ self, signature_algorithm, curve
+ ):
+ """
+ Returns True if the backend supports the named elliptic curve with the
+ specified signature algorithm.
+ """
+
+ @abc.abstractmethod
+ def elliptic_curve_supported(self, curve):
+ """
+ Returns True if the backend supports the named elliptic curve.
+ """
+
+ @abc.abstractmethod
+ def generate_elliptic_curve_private_key(self, curve):
+ """
+ Return an object conforming to the EllipticCurvePrivateKey interface.
+ """
+
+ @abc.abstractmethod
+ def elliptic_curve_public_key_from_numbers(self, numbers):
+ """
+ Return an EllipticCurvePublicKey provider using the given numbers.
+ """
+
+ @abc.abstractmethod
+ def elliptic_curve_private_key_from_numbers(self, numbers):
+ """
+ Return an EllipticCurvePublicKey provider using the given numbers.
+ """