From 8473df6d553a2e0bf790b613c2818beb4bd2f416 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 24 Nov 2014 17:13:59 -1000 Subject: add load_der_x509_certificate X509Backend method --- docs/hazmat/backends/interfaces.rst | 7 +++++++ src/cryptography/hazmat/backends/interfaces.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 3cce1576..e4c43d9e 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -525,3 +525,10 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: An instance of :class:`~cryptography.hazmat.primitives.interfaces.X509Certificate`. + + .. method:: load_der_x509_certificate(data) + + :param bytes data: DER formatted certificate data. + + :returns: An instance of + :class:`~cryptography.hazmat.primitives.interfaces.X509Certificate`. diff --git a/src/cryptography/hazmat/backends/interfaces.py b/src/cryptography/hazmat/backends/interfaces.py index dcdd1c39..8fc78309 100644 --- a/src/cryptography/hazmat/backends/interfaces.py +++ b/src/cryptography/hazmat/backends/interfaces.py @@ -259,3 +259,9 @@ class X509Backend(object): """ Load an X.509 certificate from PEM encoded data. """ + + @abc.abstractmethod + def load_der_x509_certificate(self, data): + """ + Load an X.509 certificate from DER encoded data. + """ -- cgit v1.2.3