aboutsummaryrefslogtreecommitdiffstats
path: root/docs/x509
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-01-18 13:44:40 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2017-01-18 00:44:40 -0500
commit1bab7bcf7ba08fc9534670c27a91076d2874ec76 (patch)
treefa8fcc75f1ebf191bd386ab4bf88be8081006099 /docs/x509
parent5ab97a0694fdc3650f27500ec75bfebe8398298b (diff)
downloadcryptography-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/x509')
-rw-r--r--docs/x509/reference.rst6
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(