diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-16 10:17:45 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-16 10:17:45 -0700 |
commit | e30d5a6b2d5dd413a006ff25684d69014d77dc41 (patch) | |
tree | b40a3baece4349ce23020d96baf93dc3d8d4d3e4 | |
parent | d6714012097206929fd014ed6902ac02bac827db (diff) | |
download | cryptography-e30d5a6b2d5dd413a006ff25684d69014d77dc41.tar.gz cryptography-e30d5a6b2d5dd413a006ff25684d69014d77dc41.tar.bz2 cryptography-e30d5a6b2d5dd413a006ff25684d69014d77dc41.zip |
Reorganize the backend interface definitions
-rw-r--r-- | cryptography/hazmat/backends/interfaces.py | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py index 5ed49966..75d9af6d 100644 --- a/cryptography/hazmat/backends/interfaces.py +++ b/cryptography/hazmat/backends/interfaces.py @@ -71,6 +71,21 @@ class HMACBackend(object): @six.add_metaclass(abc.ABCMeta) +class CMACBackend(object): + @abc.abstractmethod + def cmac_algorithm_supported(self, algorithm): + """ + Returns True if the block cipher is supported for CMAC by this backend + """ + + @abc.abstractmethod + def create_cmac_ctx(self, algorithm): + """ + Create a CMACContext for calculating a message authentication code. + """ + + +@six.add_metaclass(abc.ABCMeta) class PBKDF2HMACBackend(object): @abc.abstractmethod def pbkdf2_hmac_supported(self, algorithm): @@ -222,41 +237,6 @@ class DSABackend(object): @six.add_metaclass(abc.ABCMeta) -class TraditionalOpenSSLSerializationBackend(object): - @abc.abstractmethod - def load_traditional_openssl_pem_private_key(self, data, password): - """ - Load a private key from PEM encoded data, using password if the data - is encrypted. - """ - - -@six.add_metaclass(abc.ABCMeta) -class PKCS8SerializationBackend(object): - @abc.abstractmethod - def load_pkcs8_pem_private_key(self, data, password): - """ - Load a private key from PEM encoded data, using password if the data - is encrypted. - """ - - -@six.add_metaclass(abc.ABCMeta) -class CMACBackend(object): - @abc.abstractmethod - def cmac_algorithm_supported(self, algorithm): - """ - Returns True if the block cipher is supported for CMAC by this backend - """ - - @abc.abstractmethod - def create_cmac_ctx(self, algorithm): - """ - Create a CMACContext for calculating a message authentication code. - """ - - -@six.add_metaclass(abc.ABCMeta) class EllipticCurveBackend(object): @abc.abstractmethod def elliptic_curve_signature_algorithm_supported( @@ -290,3 +270,23 @@ class EllipticCurveBackend(object): """ Return an EllipticCurvePublicKey provider using the given numbers. """ + + +@six.add_metaclass(abc.ABCMeta) +class TraditionalOpenSSLSerializationBackend(object): + @abc.abstractmethod + def load_traditional_openssl_pem_private_key(self, data, password): + """ + Load a private key from PEM encoded data, using password if the data + is encrypted. + """ + + +@six.add_metaclass(abc.ABCMeta) +class PKCS8SerializationBackend(object): + @abc.abstractmethod + def load_pkcs8_pem_private_key(self, data, password): + """ + Load a private key from PEM encoded data, using password if the data + is encrypted. + """ |