aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cryptography/hazmat/backends/interfaces.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py
index e4c1df34..9539d839 100644
--- a/cryptography/hazmat/backends/interfaces.py
+++ b/cryptography/hazmat/backends/interfaces.py
@@ -142,3 +142,18 @@ class OpenSSLSerializationBackend(object):
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_supported(self):
+ """
+ Returns True if the backend supports CMAC
+ """
+
+ @abc.abstractmethod
+ def create_cmac_ctx(self, key, algorithm):
+ """
+ Create a CMACContext for calculating a message authentication code.
+ """