aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-04-18 11:11:44 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-05-23 21:05:47 +0100
commitb72e53ced354e34354a321fc3d5f1ca7b6fddf4e (patch)
treee06dff540b0f9d9ade5147c42127c56715a03299
parentdf7ba81f4e89048c6a13dfded26786a7cc593762 (diff)
downloadcryptography-b72e53ced354e34354a321fc3d5f1ca7b6fddf4e.tar.gz
cryptography-b72e53ced354e34354a321fc3d5f1ca7b6fddf4e.tar.bz2
cryptography-b72e53ced354e34354a321fc3d5f1ca7b6fddf4e.zip
Add signing and verifying interfaces
-rw-r--r--cryptography/hazmat/primitives/interfaces.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py
index bec7ee7f..f270cc5a 100644
--- a/cryptography/hazmat/primitives/interfaces.py
+++ b/cryptography/hazmat/primitives/interfaces.py
@@ -507,7 +507,18 @@ class EllipticCurve(object):
@six.add_metaclass(abc.ABCMeta)
+class EllipticCurveSignatureAlgorithm(object):
+ pass
+
+
+@six.add_metaclass(abc.ABCMeta)
class EllipticCurvePrivateKey(object):
+ @abc.abstractmethod
+ def signer(self, signature_algorithm, digest_algorithm, backend):
+ """
+ Returns an AsymmetricSignatureContext used for signing data.
+ """
+
@abc.abstractproperty
def curve(self):
"""
@@ -541,12 +552,18 @@ class EllipticCurvePrivateKey(object):
@abc.abstractmethod
def public_key(self):
"""
- The ECDSAPublicKey for this private key.
+ The EllipticCurvePublicKey for this private key.
"""
@six.add_metaclass(abc.ABCMeta)
class EllipticCurvePublicKey(object):
+ @abc.abstractmethod
+ def verifier(self, signature_algorithm, digest_algorithm, backend):
+ """
+ Returns an AsymmetricSignatureContext used for signing data.
+ """
+
@abc.abstractproperty
def curve(self):
"""