diff options
author | Sybren A. St?vel <sybren@stuvel.eu> | 2016-01-18 15:39:50 +0100 |
---|---|---|
committer | Sybren A. St?vel <sybren@stuvel.eu> | 2016-01-18 15:39:50 +0100 |
commit | 29d202d869e96e50637f9bb1a96703e169c560f7 (patch) | |
tree | 9697ae328aace24aaa2d34ac1a55ea77ef3320e9 /doc | |
parent | 533aba5392581833f6cff91944db5afbcba67833 (diff) | |
download | rsa-29d202d869e96e50637f9bb1a96703e169c560f7.tar.gz |
Updated key loading example and included it as unit test, fixes bug #31
Diffstat (limited to 'doc')
-rw-r--r-- | doc/usage.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/usage.rst b/doc/usage.rst index b2a788d..363788f 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -36,9 +36,9 @@ Alternatively you can use :py:meth:`rsa.PrivateKey.load_pkcs1` and :py:meth:`rsa.PublicKey.load_pkcs1` to load keys from a file: >>> import rsa - >>> with open('private.pem') as privatefile: + >>> with open('private.pem', mode='rb') as privatefile: ... keydata = privatefile.read() - >>> pubkey = rsa.PrivateKey.load_pkcs1(keydata) + >>> privkey = rsa.PrivateKey.load_pkcs1(keydata) Time to generate a key |