aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat
diff options
context:
space:
mode:
Diffstat (limited to 'docs/hazmat')
-rw-r--r--docs/hazmat/backends/interfaces.rst6
-rw-r--r--docs/hazmat/primitives/asymmetric/serialization.rst21
2 files changed, 27 insertions, 0 deletions
diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst
index f8341d11..e8e1bac2 100644
--- a/docs/hazmat/backends/interfaces.rst
+++ b/docs/hazmat/backends/interfaces.rst
@@ -595,6 +595,12 @@ A specific ``backend`` may provide one or more of these interfaces.
:raises cryptography.exceptions.UnsupportedAlgorithm: If the data is
encrypted with an unsupported algorithm.
+ .. method:: load_pem_public_key(data)
+
+ :param bytes data: PEM data to load.
+ :return: A new instance of the appropriate type of public key serialized data contains.
+ :raises ValueError: If the data could not be deserialized.
+
.. class:: TraditionalOpenSSLSerializationBackend
.. versionadded:: 0.3
diff --git a/docs/hazmat/primitives/asymmetric/serialization.rst b/docs/hazmat/primitives/asymmetric/serialization.rst
index 7a953d9b..18b89c44 100644
--- a/docs/hazmat/primitives/asymmetric/serialization.rst
+++ b/docs/hazmat/primitives/asymmetric/serialization.rst
@@ -92,6 +92,27 @@ all begin with ``-----BEGIN {format}-----`` and end with ``-----END
is not supported by the backend or if the key is encrypted with a
symmetric cipher that is not supported by the backend.
+.. function:: load_pem_public_key(data, backend):
+
+ .. versionadded:: 0.6
+
+ Deserialize a public key from PEM encoded data to one of the supported
+ asymmetric public key types.
+
+ :param bytes data: The PEM encoded key data.
+
+ :param backend: A
+ :class:`~cryptography.hazmat.backends.interfaces.PEMSerializationBackend`
+ provider.
+
+ :returns: A new instance of a public key.
+
+ :raises ValueError: If the PEM data could not be decrypted or if its
+ structure could not be decoded successfully.
+
+ :raises UnsupportedAlgorithm: If the serialized key is of a type that
+ is not supported by the backend.
+
PKCS #8 Format
~~~~~~~~~~~~~~