aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-08-12 14:52:56 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-08-12 14:52:56 -0400
commit46c3e70466acd33c4ec980fe62a5be958ed5c2cf (patch)
tree8b46adcb972e20622e741909089016c5546e206e /docs
parentc7053706a350dad10dca38920155d8ae08b7c3c7 (diff)
downloadcryptography-46c3e70466acd33c4ec980fe62a5be958ed5c2cf.tar.gz
cryptography-46c3e70466acd33c4ec980fe62a5be958ed5c2cf.tar.bz2
cryptography-46c3e70466acd33c4ec980fe62a5be958ed5c2cf.zip
Fixed a pair of examples in teh docs
Diffstat (limited to 'docs')
-rw-r--r--docs/x509/tutorial.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/x509/tutorial.rst b/docs/x509/tutorial.rst
index 5e8d54eb..4caa90b5 100644
--- a/docs/x509/tutorial.rst
+++ b/docs/x509/tutorial.rst
@@ -37,7 +37,7 @@ are the most common types of keys on the web right now):
... backend=default_backend()
... )
>>> # Write our key to disk for safe keeping
- >>> with open("path/to/store/key.pem") as f:
+ >>> with open("path/to/store/key.pem", "w") as f:
... f.write(key.private_bytes(
... encoding=serialization.Encoding.PEM,
... format=serialization.PrivateFormat.TraditionalOpenSSL,
@@ -74,7 +74,7 @@ a few details:
... # Sign the CSR with our private key.
... ])).sign(key, hashes.SHA256(), default_backend())
>>> # Write our CSR out to disk.
- >>> with open("path/to/csr.pem") as f:
+ >>> with open("path/to/csr.pem", "w") as f:
... f.write(csr.public_bytes(serialization.Encoding.PEM))
Now we can give our CSR to a CA, who will give a certificate to us in return.