From b72e53ced354e34354a321fc3d5f1ca7b6fddf4e Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Fri, 18 Apr 2014 11:11:44 +0100 Subject: Add signing and verifying interfaces --- cryptography/hazmat/primitives/interfaces.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 @@ -506,8 +506,19 @@ 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): """ -- cgit v1.2.3