Updated key loading example and included it as unit test, fixes bug #31
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 @@
: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