aboutsummaryrefslogtreecommitdiffstats
path: root/docs/x509
diff options
context:
space:
mode:
authorTim Buchwaldt <tim@21studios.de>2015-08-26 19:15:03 +0200
committerTim Buchwaldt <tim@21studios.de>2015-08-26 19:15:03 +0200
commite7820613494bd856a84e46333b43716e5028bdbc (patch)
treeb07f0e99573451c8dbc4a05653806cb40090ae56 /docs/x509
parent42cf0b52bc14bac916460ffaee92c1994444c4cb (diff)
downloadcryptography-e7820613494bd856a84e46333b43716e5028bdbc.tar.gz
cryptography-e7820613494bd856a84e46333b43716e5028bdbc.tar.bz2
cryptography-e7820613494bd856a84e46333b43716e5028bdbc.zip
Write as binary
At least on Python3 it fails otherwise.
Diffstat (limited to 'docs/x509')
-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 6e587d8b..d1c8ba14 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", "w") as f:
+ >>> with open("path/to/store/key.pem", "wb") as f:
... f.write(key.private_bytes(
... encoding=serialization.Encoding.PEM,
... format=serialization.PrivateFormat.TraditionalOpenSSL,
@@ -75,7 +75,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", "w") as f:
+ >>> with open("path/to/csr.pem", "wb") 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.