diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-02-16 20:24:12 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-02-16 20:24:12 -0800 |
commit | 5e208e7be554cb5c132acef9754c54681e24fab9 (patch) | |
tree | 2ca9c645bcd8778a9ba83f8a1c8c670515021ab4 /src/cryptography/hazmat/primitives/asymmetric | |
parent | 426eee7e732f90f04740e055381f0b37dadc2df1 (diff) | |
parent | 25bbc150752de98b459f061ce4b90628f2108dbd (diff) | |
download | cryptography-5e208e7be554cb5c132acef9754c54681e24fab9.tar.gz cryptography-5e208e7be554cb5c132acef9754c54681e24fab9.tar.bz2 cryptography-5e208e7be554cb5c132acef9754c54681e24fab9.zip |
Merge pull request #1666 from reaperhulk/move-asym-interfaces
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. + """ |