From e0e9541322cd9186d62f0d807efd77b3467b3ad3 Mon Sep 17 00:00:00 2001 From: Alexander Gaynor Date: Sat, 19 Jul 2014 10:58:50 -0700 Subject: Document the new interface --- docs/hazmat/backends/interfaces.rst | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 63f84067..42dba723 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -578,6 +578,23 @@ A specific ``backend`` may provide one or more of these interfaces. :class:`~cryptography.hazmat.primitives.interfaces.EllipticCurvePublicKey` provider. +.. class:: PEMSerializationBackend + + .. versionadded:: 0.6 + + A backend with methods for working with any PEM encoded keys. + + .. method:: load_pem_private_key(data, password) + + :param bytes data: PEM data to load. + :param bytes password: The password to use if the data is encrypted. + Should be ``None`` is the data is not encrypted. + :return: A new instance of the appropriate type of private key that the + serialized data contains. + :raises ValueError: If the data could not be deserialized. + :raises cryptography.exceptions.UnsupportedAlgorithm: If the data is + encrypted with an unsupported algorithm. + .. class:: TraditionalOpenSSLSerializationBackend .. versionadded:: 0.3 @@ -592,8 +609,8 @@ A specific ``backend`` may provide one or more of these interfaces. :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 the appropriate private key or public key - that the serialized data contains. + :return: A new instance of the appropriate type of private key that the + serialized data contains. :raises ValueError: If the data could not be deserialized correctly. -- cgit v1.2.3 From 99e61ea62b4d9dafe0a1535a167f0773da94bb68 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 8 Sep 2014 10:26:40 -0700 Subject: typo fix --- docs/hazmat/backends/interfaces.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 42dba723..f8341d11 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -588,7 +588,7 @@ A specific ``backend`` may provide one or more of these interfaces. :param bytes data: PEM data to load. :param bytes password: The password to use if the data is encrypted. - Should be ``None`` is the data is not encrypted. + Should be ``None`` if the data is not encrypted. :return: A new instance of the appropriate type of private key that the serialized data contains. :raises ValueError: If the data could not be deserialized. -- cgit v1.2.3