OpenSSL "traditional" key format loading...
Backend interface only.
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py
index a543ba1..0a26526 100644
--- a/cryptography/hazmat/backends/interfaces.py
+++ b/cryptography/hazmat/backends/interfaces.py
@@ -105,3 +105,12 @@
Returns an object conforming to the AsymmetricVerificationContext
interface.
"""
+
+
+class OpenSSLSerializationBackend(six.with_metaclass(abc.ABCMeta)):
+ @abc.abstractmethod
+ def load_openssl_pem_private_key(data, password, backend):
+ """
+ Load a private key from PEM encoded data, using password if the data
+ is encrypted.
+ """
diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst
index bd38ed5..af19fbc 100644
--- a/docs/hazmat/backends/interfaces.rst
+++ b/docs/hazmat/backends/interfaces.rst
@@ -248,3 +248,26 @@
:returns:
:class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext`
+
+
+.. class:: OpenSSLSerializationBackend
+
+ .. versionadded:: 0.3
+
+ A backend with methods for working with OpenSSL's "traditional" PKCS #1
+ style key serialization.
+
+ .. method:: load_openssl_pem_private_key(data, password)
+
+ :param bytes data: PEM data to deserialize.
+
+ :param bytes password: The password to use if this data is encrypted.
+ Should be None if the data is not encrypted.
+
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.serialization.OpenSSLPrivateKey`
+
+ :raises ValueError: If the data could not be deserialized correctly.
+
+ :raises cryptography.exceptions.UnsupportedAlgorithm: If the data is
+ encrypted with an unsupported algorithm.
diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt
index 9bc84e5..7200855 100644
--- a/docs/spelling_wordlist.txt
+++ b/docs/spelling_wordlist.txt
@@ -13,6 +13,8 @@
decrypt
decrypted
decrypting
+deserialize
+deserialized
Docstrings
fernet
Fernet