blob: ab9e2e47baec7405ee8d7140b5303bbfa7cca937 [file] [log] [blame]
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +02001Compatibility with standards and other software
2==================================================
3
Sybren A. Stüvelc1c455d2011-08-01 23:04:30 +02004.. index:: OpenSSL
5.. index:: compatibility
6
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +02007Python-RSA implements encryption and signatures according to PKCS#1
8version 1.5. This makes it compatible with the OpenSSL RSA module.
9
10Keys are stored in PEM or DER format according to PKCS#1 v1.5. Private
11keys are compatible with OpenSSL. However, OpenSSL uses X.509 for its
12public keys, which are not supported.
13
Sybren A. Stüveldbea2132011-08-03 13:31:57 +020014Encryption:
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +020015 PKCS#1 v1.5 with at least 8 bytes of random padding
16
Sybren A. Stüveldbea2132011-08-03 13:31:57 +020017Signatures:
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +020018 PKCS#1 v1.5 using the following hash methods:
19 MD5, SHA-1, SHA-256, SHA-384, SHA-512
20
Sybren A. Stüveldbea2132011-08-03 13:31:57 +020021Private keys:
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +020022 PKCS#1 v1.5 in PEM and DER format, ASN.1 type RSAPrivateKey
23
Sybren A. Stüveldbea2132011-08-03 13:31:57 +020024Public keys:
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +020025 PKCS#1 v1.5 in PEM and DER format, ASN.1 type RSAPublicKey
26
Sybren A. Stüveldbea2132011-08-03 13:31:57 +020027:ref:`VARBLOCK <bigfiles>` encryption:
Sybren A. Stüvelc1c455d2011-08-01 23:04:30 +020028 Python-RSA only, not compatible with any other known application.
Sybren A. Stüvela3fd61a2011-07-31 00:22:31 +020029
30
31Public keys from OpenSSL
32--------------------------------------------------
33
34To get a Python-RSA-compatible public key from OpenSSL, you need the
35private key. Get the private key in PEM or DER format and run it
36through the ``pyrsa-priv2pub`` command::
37
38
39 Usage: pyrsa-priv2pub [options]
40
41 Reads a private key and outputs the corresponding public key. Both
42 private and public keys use the format described in PKCS#1 v1.5
43
44 Options:
45 -h, --help show this help message and exit
46 --in=INFILENAME Input filename. Reads from stdin if not specified
47 --out=OUTFILENAME Output filename. Writes to stdout of not specified
48 --inform=INFORM key format of input - default PEM
49 --outform=OUTFORM key format of output - default PEM
Sybren A. Stüveld92b6672011-07-31 17:44:44 +020050