diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-16 13:17:14 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-16 14:34:11 -0600 |
commit | 0d6203f25ad15d5e369e23c8a30ba9d2e42eaf1e (patch) | |
tree | 74f152da91f230f3b8c006e0ebca3eb5f86cf770 /src/cryptography/hazmat/primitives/asymmetric | |
parent | 426eee7e732f90f04740e055381f0b37dadc2df1 (diff) | |
download | cryptography-0d6203f25ad15d5e369e23c8a30ba9d2e42eaf1e.tar.gz cryptography-0d6203f25ad15d5e369e23c8a30ba9d2e42eaf1e.tar.bz2 cryptography-0d6203f25ad15d5e369e23c8a30ba9d2e42eaf1e.zip |
move asymmetric signature/verification interfaces
Diffstat (limited to 'src/cryptography/hazmat/primitives/asymmetric')
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/__init__.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/__init__.py b/src/cryptography/hazmat/primitives/asymmetric/__init__.py index 4b540884..494a7a13 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/__init__.py +++ b/src/cryptography/hazmat/primitives/asymmetric/__init__.py @@ -3,3 +3,38 @@ # for complete details. from __future__ import absolute_import, division, print_function + +import abc + +import six + + +@six.add_metaclass(abc.ABCMeta) +class AsymmetricSignatureContext(object): + @abc.abstractmethod + def update(self, data): + """ + Processes the provided bytes and returns nothing. + """ + + @abc.abstractmethod + def finalize(self): + """ + Returns the signature as bytes. + """ + + +@six.add_metaclass(abc.ABCMeta) +class AsymmetricVerificationContext(object): + @abc.abstractmethod + def update(self, data): + """ + Processes the provided bytes and returns nothing. + """ + + @abc.abstractmethod + def verify(self): + """ + Raises an exception if the bytes provided to update do not match the + signature or the signature does not match the public key. + """ |