summaryrefslogtreecommitdiff
path: root/doc/compatibility.rst
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2011-08-03 13:56:32 +0200
committerSybren A. Stüvel <sybren@stuvel.eu>2011-08-03 13:56:32 +0200
commit58fe9468aaeb0910e08502d6d82184e2ef8b1901 (patch)
tree132be36f986c68ab654a782eb84739d69dbba8f9 /doc/compatibility.rst
parentdbea213e8875d53087b5b3adf85c7004f13b05d8 (diff)
downloadrsa-git-58fe9468aaeb0910e08502d6d82184e2ef8b1901.tar.gz
More documentation about key size and OpenSSL compatibility
Diffstat (limited to 'doc/compatibility.rst')
-rw-r--r--doc/compatibility.rst33
1 files changed, 17 insertions, 16 deletions
diff --git a/doc/compatibility.rst b/doc/compatibility.rst
index ab9e2e4..d82d1fa 100644
--- a/doc/compatibility.rst
+++ b/doc/compatibility.rst
@@ -27,24 +27,25 @@ Public keys:
:ref:`VARBLOCK <bigfiles>` encryption:
Python-RSA only, not compatible with any other known application.
+.. _openssl:
-Public keys from OpenSSL
+Interoperability with OpenSSL
--------------------------------------------------
+You can create a 512-bit RSA key in OpenSSL as follows::
+
+ openssl genrsa -out myprivatekey.pem 512
+
To get a Python-RSA-compatible public key from OpenSSL, you need the
-private key. Get the private key in PEM or DER format and run it
-through the ``pyrsa-priv2pub`` command::
-
-
- Usage: pyrsa-priv2pub [options]
-
- Reads a private key and outputs the corresponding public key. Both
- private and public keys use the format described in PKCS#1 v1.5
-
- Options:
- -h, --help show this help message and exit
- --in=INFILENAME Input filename. Reads from stdin if not specified
- --out=OUTFILENAME Output filename. Writes to stdout of not specified
- --inform=INFORM key format of input - default PEM
- --outform=OUTFORM key format of output - default PEM
+private key first, then run it through the ``pyrsa-priv2pub``
+command::
+
+ pyrsa-priv2pub -i myprivatekey.pem -o mypublickey.pem
+
+Encryption and decryption is also compatible::
+
+ $ echo hello there > testfile.txt
+ $ pyrsa-encrypt -i testfile.txt -o testfile.rsa publickey.pem
+ $ openssl rsautl -in testfile.rsa -inkey privatekey.pem -decrypt
+ hello there