diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-17 13:14:03 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-28 12:33:34 -0500 |
commit | fa56a23061c8b3431aa32b7ffbd05a38fa6f77e4 (patch) | |
tree | 6c884d20d1f165cf7c42548d4877f9ed4e44cd79 /docs | |
parent | 320050b92d98c9dd8f3949f04a13756a4018f85d (diff) | |
download | cryptography-fa56a23061c8b3431aa32b7ffbd05a38fa6f77e4.tar.gz cryptography-fa56a23061c8b3431aa32b7ffbd05a38fa6f77e4.tar.bz2 cryptography-fa56a23061c8b3431aa32b7ffbd05a38fa6f77e4.zip |
basicConstraints support for OpenSSL X509 backend
Diffstat (limited to 'docs')
-rw-r--r-- | docs/x509.rst | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/x509.rst b/docs/x509.rst index 44d53a45..f17c3dae 100644 --- a/docs/x509.rst +++ b/docs/x509.rst @@ -205,6 +205,12 @@ X.509 Certificate Object :raises cryptography.x509.DuplicateExtension: If more than one extension of the same type is found within the certificate. + .. doctest:: + + >>> for ext in cert.extensions: + ... print(ext) + <Extension(oid=<ObjectIdentifier(oid=2.5.29.19, name=basicConstraints)>, critical=True, value=<BasicConstraints(ca=True, path_length=None)>)> + .. class:: Name .. versionadded:: 0.8 @@ -292,6 +298,23 @@ X.509 Extensions An X.509 Extensions instance is an ordered list of extensions. The object is iterable to get every extension. + .. method:: get_extension_for_oid(oid) + + :param oid: An :class:`ObjectIdentifier` instance. + + :returns: An instance of the extension class. + + :raises cryptography.x509.ExtensionNotFound: If the certificate does + not have the extension requested. + + :raises cryptography.x509.UnsupportedExtension: If the certificate + contains an extension that is not supported. + + .. doctest:: + + >>> cert.extensions.get_extension_for_oid(x509.OID_BASIC_CONSTRAINTS) + <Extension(oid=<ObjectIdentifier(oid=2.5.29.19, name=basicConstraints)>, critical=True, value=<BasicConstraints(ca=True, path_length=None)>)> + .. class:: Extension .. versionadded:: 0.9 @@ -546,6 +569,17 @@ Exceptions Returns the OID. +.. class:: ExtensionNotFound + + This is raised when calling :meth:`Extensions.get_extension_for_oid` with + an extension OID that is not present in the certificate. + + .. attribute:: oid + + :type: :class:`ObjectIdentifier` + + Returns the OID. + .. _`public key infrastructure`: https://en.wikipedia.org/wiki/Public_key_infrastructure .. _`TLS`: https://en.wikipedia.org/wiki/Transport_Layer_Security |