aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-01-17 13:57:41 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2015-01-17 13:57:41 -0500
commit2dcdf87195b9bbe3be8abd5439ebc14a4e8bfe36 (patch)
treee09dda9d096e5b6a1d922a793780480fc45601ac /src
parentec8a4cdfbd074d606e506f23eca5b75cc904923b (diff)
parente788fa9866494aed36436a6c1eaeb8a33409b770 (diff)
downloadcryptography-2dcdf87195b9bbe3be8abd5439ebc14a4e8bfe36.tar.gz
cryptography-2dcdf87195b9bbe3be8abd5439ebc14a4e8bfe36.tar.bz2
cryptography-2dcdf87195b9bbe3be8abd5439ebc14a4e8bfe36.zip
Merge pull request #1608 from reaperhulk/der-backend-interfaces
add DER backend interfaces
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/interfaces.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/interfaces.py b/src/cryptography/hazmat/backends/interfaces.py
index 4dc879ac..79808909 100644
--- a/src/cryptography/hazmat/backends/interfaces.py
+++ b/src/cryptography/hazmat/backends/interfaces.py
@@ -233,6 +233,22 @@ class PEMSerializationBackend(object):
@six.add_metaclass(abc.ABCMeta)
+class DERSerializationBackend(object):
+ @abc.abstractmethod
+ def load_der_private_key(self, data, password):
+ """
+ Loads a private key from DER encoded data. Uses the provided password
+ if the data is encrypted.
+ """
+
+ @abc.abstractmethod
+ def load_der_public_key(self, data):
+ """
+ Loads a public key from DER encoded data.
+ """
+
+
+@six.add_metaclass(abc.ABCMeta)
class X509Backend(object):
@abc.abstractmethod
def load_pem_x509_certificate(self, data):