diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-01-18 13:44:40 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-01-18 00:44:40 -0500 |
commit | 1bab7bcf7ba08fc9534670c27a91076d2874ec76 (patch) | |
tree | fa8fcc75f1ebf191bd386ab4bf88be8081006099 /docs | |
parent | 5ab97a0694fdc3650f27500ec75bfebe8398298b (diff) | |
download | cryptography-1bab7bcf7ba08fc9534670c27a91076d2874ec76.tar.gz cryptography-1bab7bcf7ba08fc9534670c27a91076d2874ec76.tar.bz2 cryptography-1bab7bcf7ba08fc9534670c27a91076d2874ec76.zip |
add a SAN to the certificatebuilder example (#3353)
Evidently users copy/paste these examples so adding a SAN here will help
people screw up less. Fixes #3314
Diffstat (limited to 'docs')
-rw-r--r-- | docs/x509/reference.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst index 68e1f73c..1823231f 100644 --- a/docs/x509/reference.rst +++ b/docs/x509/reference.rst @@ -601,6 +601,12 @@ X.509 Certificate Builder >>> builder = builder.serial_number(x509.random_serial_number()) >>> builder = builder.public_key(public_key) >>> builder = builder.add_extension( + ... x509.SubjectAlternativeName( + ... [x509.DNSName(u'cryptography.io')] + ... ), + ... critical=False + ... ) + >>> builder = builder.add_extension( ... x509.BasicConstraints(ca=False, path_length=None), critical=True, ... ) >>> certificate = builder.sign( |