From 76da86a9d5f5b395a89e2768d07b19b23a96d8d8 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 4 Jan 2015 15:54:32 -0600 Subject: add DER backend interfaces --- src/cryptography/hazmat/backends/interfaces.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/interfaces.py b/src/cryptography/hazmat/backends/interfaces.py index 4dc879ac..6feb8106 100644 --- a/src/cryptography/hazmat/backends/interfaces.py +++ b/src/cryptography/hazmat/backends/interfaces.py @@ -232,6 +232,22 @@ class PEMSerializationBackend(object): """ +@six.add_metaclass(abc.ABCMeta) +class DERSerializationBackend(object): + @abc.abstractmethod + def load_der_private_key(self, data, password): + """ + Loads a priate 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 -- cgit v1.2.3