diff options
-rw-r--r-- | docs/x509.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/x509.rst b/docs/x509.rst index a8beb20a..6bb7c9a3 100644 --- a/docs/x509.rst +++ b/docs/x509.rst @@ -760,9 +760,10 @@ X.509 Extensions >>> from cryptography.hazmat.backends import default_backend >>> from cryptography.hazmat.primitives import hashes >>> cert = x509.load_pem_x509_certificate(cryptography_cert_pem, default_backend()) + >>> # Get the subjectAltName extension from the certificate >>> ext = cert.extensions.get_extension_for_oid(x509.OID_SUBJECT_ALTERNATIVE_NAME) - >>> san = ext.value - >>> san.get_values_for_type(x509.DNSName) + >>> # Get the dNSName entries from the SAN extension + >>> ext.value.get_values_for_type(x509.DNSName) [u'www.cryptography.io', u'cryptography.io'] |