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-21 11:12:33 +0100 |
commit | f68c52a018721dfb536cc735a6bfee4a9af1c419 (patch) | |
tree | 9697ae328aace24aaa2d34ac1a55ea77ef3320e9 /doc | |
parent | e798a6e726eb6497b45e91bfdc498613528b16b2 (diff) | |
download | rsa-git-f68c52a018721dfb536cc735a6bfee4a9af1c419.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 |