aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-15 11:40:17 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-15 11:40:17 -0400
commit969e27a8c0cda40b1ac3bb5bef99ac86eecad1c1 (patch)
tree7d1fb533abcd50fd4cea10adb7ca4a54b3f2ab48
parent0d8583168bb2bba872708d2913002a47633362d1 (diff)
downloadcryptography-969e27a8c0cda40b1ac3bb5bef99ac86eecad1c1.tar.gz
cryptography-969e27a8c0cda40b1ac3bb5bef99ac86eecad1c1.tar.bz2
cryptography-969e27a8c0cda40b1ac3bb5bef99ac86eecad1c1.zip
add signer/verifier to the abcs
-rw-r--r--cryptography/hazmat/primitives/interfaces.py12
1 files changed, 12 insertions, 0 deletions
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):
"""