diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-11 22:51:27 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-11 23:02:01 -0400 |
commit | 61ff35662049f02da8d2c0f54ef6e84f97c14b1a (patch) | |
tree | 9ed62e6417eb49cec6c9230047a4c3f8ee0e0599 /docs/x509/reference.rst | |
parent | e40a03f61e907d0de5fb07624cb6306323de543d (diff) | |
download | cryptography-61ff35662049f02da8d2c0f54ef6e84f97c14b1a.tar.gz cryptography-61ff35662049f02da8d2c0f54ef6e84f97c14b1a.tar.bz2 cryptography-61ff35662049f02da8d2c0f54ef6e84f97c14b1a.zip |
Add AuthorityKeyIdentifier.from_issuer_subject_key_identifier
Diffstat (limited to 'docs/x509/reference.rst')
-rw-r--r-- | docs/x509/reference.rst | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst index 67427ddb..1e8aebad 100644 --- a/docs/x509/reference.rst +++ b/docs/x509/reference.rst @@ -1568,6 +1568,32 @@ X.509 Extensions >>> x509.AuthorityKeyIdentifier.from_issuer_public_key(issuer_cert.public_key()) <AuthorityKeyIdentifier(key_identifier='X\x01\x84$\x1b\xbc+R\x94J=\xa5\x10r\x14Q\xf5\xaf:\xc9', authority_cert_issuer=None, authority_cert_serial_number=None)> + .. classmethod:: from_issuer_subject_key_identifier(ski) + + .. versionadded:: 1.3 + + Creates a new AuthorityKeyIdentifier instance using the + SubjectKeyIdentifier from the issuer certificate. The resulting object + will contain + :attr:`~cryptography.x509.AuthorityKeyIdentifier.key_identifier`, but + :attr:`~cryptography.x509.AuthorityKeyIdentifier.authority_cert_issuer` + and + :attr:`~cryptography.x509.AuthorityKeyIdentifier.authority_cert_serial_number` + will be None. + + :param ski: The + :class:`~cryptography.x509.SubjectKeyIdentifier` from the issuer + certificate. + + .. doctest:: + + >>> from cryptography import x509 + >>> from cryptography.hazmat.backends import default_backend + >>> issuer_cert = x509.load_pem_x509_certificate(pem_data, default_backend()) + >>> ski = issuer_cert.extensions.get_extension_for_class(x509.SubjectKeyIdentifier) + >>> x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier(ski) + <AuthorityKeyIdentifier(key_identifier='X\x01\x84$\x1b\xbc+R\x94J=\xa5\x10r\x14Q\xf5\xaf:\xc9', authority_cert_issuer=None, authority_cert_serial_number=None)> + .. class:: SubjectKeyIdentifier(digest) .. versionadded:: 0.9 |