summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2020-08-04 22:50:02 -0500
committerGitHub <noreply@github.com>2020-08-04 23:50:02 -0400
commitc898871daac710f00154cb7041e3876fc66c1ef5 (patch)
tree7e6b57022c021b285a1988d5820bde78d34197ea /docs
parent143f56f65cd4c78eecdd9f09fa8e0e806f01c203 (diff)
downloadcryptography-c898871daac710f00154cb7041e3876fc66c1ef5.tar.gz
support PKCS7 certificate parsing (#5371)
* support PKCS7 certificate parsing * refcounts are different in 1.0.2 * rename the functions * black * empty commit * review feedback
Diffstat (limited to 'docs')
-rw-r--r--docs/hazmat/primitives/asymmetric/serialization.rst50
1 files changed, 50 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/serialization.rst b/docs/hazmat/primitives/asymmetric/serialization.rst
index b2030609a..164ba376c 100644
--- a/docs/hazmat/primitives/asymmetric/serialization.rst
+++ b/docs/hazmat/primitives/asymmetric/serialization.rst
@@ -528,6 +528,56 @@ file suffix.
:return bytes: Serialized PKCS12.
+PKCS7
+~~~~~
+
+.. currentmodule:: cryptography.hazmat.primitives.serialization.pkcs7
+
+PKCS7 is a format described in :rfc:`2315`, among other specifications. It can
+contain certificates, CRLs, and much more. PKCS7 files commonly have a ``p7b``,
+``p7m``, or ``p7s`` file suffix but other suffixes are also seen in the wild.
+
+.. note::
+
+ ``cryptography`` only supports parsing certificates from PKCS7 files at
+ this time.
+
+.. function:: load_pem_pkcs7_certificates(data)
+
+ .. versionadded:: 3.1
+
+ Deserialize a PEM encoded PKCS7 blob to a list of certificates. PKCS7 can
+ contain many other types of data, including CRLs, but this function will
+ ignore everything except certificates.
+
+ :param data: The data.
+ :type data: bytes
+
+ :returns: A list of :class:`~cryptography.x509.Certificate`.
+
+ :raises ValueError: If the PKCS7 data could not be loaded.
+
+ :raises cryptography.exceptions.UnsupportedAlgorithm: If the PKCS7 data
+ is of a type that is not supported.
+
+.. function:: load_der_pkcs7_certificates(data)
+
+ .. versionadded:: 3.1
+
+ Deserialize a DER encoded PKCS7 blob to a list of certificates. PKCS7 can
+ contain many other types of data, including CRLs, but this function will
+ ignore everything except certificates.
+
+ :param data: The data.
+ :type data: bytes
+
+ :returns: A list of :class:`~cryptography.x509.Certificate`.
+
+ :raises ValueError: If the PKCS7 data could not be loaded.
+
+ :raises cryptography.exceptions.UnsupportedAlgorithm: If the PKCS7 data
+ is of a type that is not supported.
+
Serialization Formats
~~~~~~~~~~~~~~~~~~~~~