From 15b6ede389f7abc7064a65b88c864fa8a2aca816 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Tue, 15 Apr 2014 18:16:27 +0800 Subject: Added CMAC backend interface --- cryptography/hazmat/backends/interfaces.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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. + """ -- cgit v1.2.3