aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.