aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-17 19:19:43 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-17 19:19:43 -0600
commite9a11f735e27059bce71bcafc7f91bbacf29c0f5 (patch)
treeb1d308275436c42f0a2b48042dbd1897af7d4cf0
parent25a689dbc000ed64bb0d67b0747c9c5bae2936bd (diff)
downloadcryptography-e9a11f735e27059bce71bcafc7f91bbacf29c0f5.tar.gz
cryptography-e9a11f735e27059bce71bcafc7f91bbacf29c0f5.tar.bz2
cryptography-e9a11f735e27059bce71bcafc7f91bbacf29c0f5.zip
add AsymmetricSignContext, AsymmetricVerifyContext, AsymmetricPadding
-rw-r--r--cryptography/hazmat/primitives/interfaces.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py
index 5ef469d0..ea29e713 100644
--- a/cryptography/hazmat/primitives/interfaces.py
+++ b/cryptography/hazmat/primitives/interfaces.py
@@ -287,6 +287,43 @@ class RSAPublicKey(six.with_metaclass(abc.ABCMeta)):
"""
+class AsymmetricSignContext(six.with_metaclass(abc.ABCMeta)):
+ @abc.abstractmethod
+ def update(self, data):
+ """
+ Processes the provided bytes and returns nothing.
+ """
+
+ @abc.abstractmethod
+ def finalize(self):
+ """
+ Returns the signature as bytes.
+ """
+
+
+class AsymmetricVerifyContext(six.with_metaclass(abc.ABCMeta)):
+ @abc.abstractmethod
+ def update(self, data):
+ """
+ Processes the provided bytes and returns nothing.
+ """
+
+ @abc.abstractmethod
+ def finalize(self):
+ """
+ Raises an exception if the bytes provided to update do not match the
+ signature or the signature does not match the public key.
+ """
+
+
+class AsymmetricPadding(six.with_metaclass(abc.ABCMeta)):
+ @abc.abstractproperty
+ def name(self):
+ """
+ A string naming this padding (e.g. "PSS", "PKCS1").
+ """
+
+
class KeyDerivationFunction(six.with_metaclass(abc.ABCMeta)):
@abc.abstractmethod
def derive(self, key_material):