From f68c52a018721dfb536cc735a6bfee4a9af1c419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 18 Jan 2016 15:39:50 +0100 Subject: Updated key loading example and included it as unit test, fixes bug #31 --- doc/usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') 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 -- cgit v1.2.1