aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-07-16 13:50:38 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-07-16 13:50:38 -0500
commit250098ca84df65741c279d76de2ea6bc4f83aaa0 (patch)
treedbc9644e0c18e75a96593adf7f91f6921e021dce
parente943b7905c56998bec40a762b41496ccd356f6c3 (diff)
parente30d5a6b2d5dd413a006ff25684d69014d77dc41 (diff)
downloadcryptography-250098ca84df65741c279d76de2ea6bc4f83aaa0.tar.gz
cryptography-250098ca84df65741c279d76de2ea6bc4f83aaa0.tar.bz2
cryptography-250098ca84df65741c279d76de2ea6bc4f83aaa0.zip
Merge pull request #1271 from alex/organize
Reorganize the backend interface definitions
-rw-r--r--cryptography/hazmat/backends/interfaces.py70
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.
+ """