aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-11-10 20:36:45 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-11-11 09:36:45 +0800
commit1396f388c8311b70386445f1bbf4b20b3e1f66b0 (patch)
treec3732f89b56e11db2a8465bd47899e2548ec7512 /docs
parent1a73704b8cf432fb74fc9f52ed4a0ac6637e078f (diff)
downloadcryptography-1396f388c8311b70386445f1bbf4b20b3e1f66b0.tar.gz
cryptography-1396f388c8311b70386445f1bbf4b20b3e1f66b0.tar.bz2
cryptography-1396f388c8311b70386445f1bbf4b20b3e1f66b0.zip
Fixed #4377 -- document certificate policies with an example (#5058)
Diffstat (limited to 'docs')
-rw-r--r--docs/x509/reference.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst
index 6eca950b..7f75f69d 100644
--- a/docs/x509/reference.rst
+++ b/docs/x509/reference.rst
@@ -2483,6 +2483,18 @@ X.509 Extensions
:param list policies: A list of :class:`PolicyInformation` instances.
+ As an example of how ``CertificatePolicies`` might be used, if you wanted
+ to check if a certificated contained the CAB Forum's "domain-validated"
+ policy, you might write code like:
+
+ .. code-block:: python
+
+ def contains_domain_validated(policies):
+ return any(
+ policy.oid.dotted_string == "2.23.140.1.2.1"
+ for policy in policies
+ )
+
.. attribute:: oid
.. versionadded:: 1.0