diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-28 16:40:02 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-28 16:40:02 -0400 |
commit | 554104d69e00d7afbea3c69f8e956e84bda5f1af (patch) | |
tree | 15d91fef1f83ca95a47334bacc9ba68e886a1a18 /docs/x509.rst | |
parent | 11f1f82ac628712015531b6cbddf5daeb6fd4acf (diff) | |
parent | de813eab6dcd19372fe7aade302f90fe2dac9d03 (diff) | |
download | cryptography-554104d69e00d7afbea3c69f8e956e84bda5f1af.tar.gz cryptography-554104d69e00d7afbea3c69f8e956e84bda5f1af.tar.bz2 cryptography-554104d69e00d7afbea3c69f8e956e84bda5f1af.zip |
Merge pull request #1769 from reaperhulk/x509-extension-bc
basicConstraints support for OpenSSL X509 backend
Diffstat (limited to 'docs/x509.rst')
-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 |