aboutsummaryrefslogtreecommitdiffstats
path: root/docs/x509
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-08-12 10:57:38 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-08-12 10:57:38 -0500
commit0a12276df5db502927f9aaa8117ea746bf29f9f0 (patch)
tree9195d6410196e2376142ae3182c66f3224178cfe /docs/x509
parent0998a1a6a3f390a40b74f2cb3fbb36cb07e9c63e (diff)
parentcb5ec4e90ea06d0b5ee95c68c26927ab7623b588 (diff)
downloadcryptography-0a12276df5db502927f9aaa8117ea746bf29f9f0.tar.gz
cryptography-0a12276df5db502927f9aaa8117ea746bf29f9f0.tar.bz2
cryptography-0a12276df5db502927f9aaa8117ea746bf29f9f0.zip
Merge pull request #2267 from queenp/iss2255
added get_extension_for_class #2255
Diffstat (limited to 'docs/x509')
-rw-r--r--docs/x509/reference.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst
index 8d5d6a6f..62bdb3a9 100644
--- a/docs/x509/reference.rst
+++ b/docs/x509/reference.rst
@@ -889,6 +889,23 @@ X.509 Extensions
>>> cert.extensions.get_extension_for_oid(ExtensionOID.BASIC_CONSTRAINTS)
<Extension(oid=<ObjectIdentifier(oid=2.5.29.19, name=basicConstraints)>, critical=True, value=<BasicConstraints(ca=True, path_length=None)>)>
+ .. method:: get_extension_for_class(extclass)
+
+ .. versionadded:: 1.1
+
+ :param extclass: An extension class.
+
+ :returns: An instance of the extension class.
+
+ :raises cryptography.x509.ExtensionNotFound: If the certificate does
+ not have the extension requested.
+
+ .. doctest::
+
+ >>> from cryptography import x509
+ >>> cert.extensions.get_extension_for_class(x509.BasicConstraints)
+ <Extension(oid=<ObjectIdentifier(oid=2.5.29.19, name=basicConstraints)>, critical=True, value=<BasicConstraints(ca=True, path_length=None)>)>
+
.. class:: Extension
.. versionadded:: 0.9