From 969e27a8c0cda40b1ac3bb5bef99ac86eecad1c1 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 15 Apr 2014 11:40:17 -0400 Subject: add signer/verifier to the abcs --- cryptography/hazmat/primitives/interfaces.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index e70338ba..4d92ef27 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -185,6 +185,12 @@ class HashContext(object): @six.add_metaclass(abc.ABCMeta) class RSAPrivateKey(object): + @abc.abstractmethod + def signer(self, padding, algorithm, backend): + """ + Returns an AsymmetricSignatureContext used for signing data. + """ + @abc.abstractproperty def modulus(self): """ @@ -270,6 +276,12 @@ class RSAPrivateKey(object): @six.add_metaclass(abc.ABCMeta) class RSAPublicKey(object): + @abc.abstractmethod + def verifier(self, signature, padding, algorithm, backend): + """ + Returns an AsymmetricVerificationContext used for verifying signatures. + """ + @abc.abstractproperty def modulus(self): """ -- cgit v1.2.3