summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLegrandin <gooksankoo@hoiptorrow.mailexpire.com>2012-04-12 23:16:52 +0200
committerLegrandin <gooksankoo@hoiptorrow.mailexpire.com>2012-04-12 23:16:52 +0200
commite6ef5dee7b62ac0d6021e53c88a30de49201d589 (patch)
tree2edcba42456169316ee4a45d2ec11ad2535edf50
parent35a748d4826346dd589fd037b5f7cd7229bd5c82 (diff)
downloadpycrypto-e6ef5dee7b62ac0d6021e53c88a30de49201d589.tar.gz
Polished the Crypto.PublicKey page.Added hyperlinks to RFCs.
-rw-r--r--lib/Crypto/PublicKey/ElGamal.py2
-rw-r--r--lib/Crypto/PublicKey/RSA.py19
-rw-r--r--lib/Crypto/PublicKey/__init__.py2
-rw-r--r--lib/Crypto/PublicKey/qNEW.py2
4 files changed, 20 insertions, 5 deletions
diff --git a/lib/Crypto/PublicKey/ElGamal.py b/lib/Crypto/PublicKey/ElGamal.py
index 793d970..62a9c3a 100644
--- a/lib/Crypto/PublicKey/ElGamal.py
+++ b/lib/Crypto/PublicKey/ElGamal.py
@@ -23,6 +23,8 @@
# SOFTWARE.
# ===================================================================
+"""ElGamal public-key algorithm (encryption and signature)."""
+
__revision__ = "$Id$"
from Crypto.PublicKey.pubkey import *
diff --git a/lib/Crypto/PublicKey/RSA.py b/lib/Crypto/PublicKey/RSA.py
index 419dac4..a4c40a2 100644
--- a/lib/Crypto/PublicKey/RSA.py
+++ b/lib/Crypto/PublicKey/RSA.py
@@ -22,7 +22,7 @@
# SOFTWARE.
# ===================================================================
-"""RSA public-key cryptography algorithm.
+"""RSA public-key cryptography algorithm (signature and encryption).
RSA_ is the most widespread and used public key algorithm. Its security is
based on the difficulty of factoring large integers. The algorithm has
@@ -308,7 +308,7 @@ class _RSAobj(pubkey.pubkey):
:Parameter format: The format to use for wrapping the key.
- *'DER'*. Binary encoding, always unencrypted.
- - *'PEM'*. Textual encoding, done according to RFC1421/3.
+ - *'PEM'*. Textual encoding, done according to `RFC1421`_/`RFC1423`_.
Unencrypted (default) or encrypted.
- *'OpenSSH'*. Textual encoding, done according to OpenSSH specification.
Only suitable for public keys (not private keys).
@@ -318,7 +318,7 @@ class _RSAobj(pubkey.pubkey):
:Type passphrase: string
:Parameter pkcs: The PKCS standard to follow for encoding the key.
- You have two choices: **1** (PKCS#1, RFC3447) or **8** (PKCS#8, RFC5208).
+ You have two choices: **1** (PKCS#1, `RFC3447`_) or **8** (PKCS#8, `RFC5208`_).
PKCS#8 is only available for private keys.
PKCS#1 is the default.
PKCS standards are not relevant for the *OpenSSH* format.
@@ -327,6 +327,11 @@ class _RSAobj(pubkey.pubkey):
:Return: A byte string with the encoded public or private half.
:Raise ValueError:
When the format is unknown.
+
+ .. _RFC1421: http://www.ietf.org/rfc/rfc1421.txt
+ .. _RFC1423: http://www.ietf.org/rfc/rfc1423.txt
+ .. _RFC3447: http://www.ietf.org/rfc/rfc3447.txt
+ .. _RFC5208: http://www.ietf.org/rfc/rfc5208.txt
"""
if passphrase is not None:
passphrase = tobytes(passphrase)
@@ -580,9 +585,9 @@ class RSAImplementation(object):
The key can be in any of the following formats:
- DER + PKCS#1 (binary)
- - PEM + PKCS#1 (textual, according to RFC1421/3)
+ - PEM + PKCS#1 (textual, according to `RFC1421`_/`RFC1423`_)
- DER + PKCS#8 (binary, private key only)
- - PEM + PKCS#8 (textual, according to RFC5208, private key only)
+ - PEM + PKCS#8 (textual, according to `RFC5208`_, private key only)
- OpenSSH (textual public key only)
In case of PEM + PKCS#1, the key can be encrypted with DES or 3TDES according to a certain ``pass phrase``.
@@ -597,6 +602,10 @@ class RSAImplementation(object):
:Raise ValueError/IndexError/TypeError:
When the given key cannot be parsed (possibly because the pass phrase is wrong).
+
+ .. _RFC1421: http://www.ietf.org/rfc/rfc1421.txt
+ .. _RFC1423: http://www.ietf.org/rfc/rfc1423.txt
+ .. _RFC5208: http://www.ietf.org/rfc/rfc5208.txt
"""
externKey = tobytes(externKey)
if passphrase is not None:
diff --git a/lib/Crypto/PublicKey/__init__.py b/lib/Crypto/PublicKey/__init__.py
index 5b57d6c..f966270 100644
--- a/lib/Crypto/PublicKey/__init__.py
+++ b/lib/Crypto/PublicKey/__init__.py
@@ -33,6 +33,8 @@ Crypto.PublicKey.ElGamal (Signing and encryption)
Crypto.PublicKey.RSA (Signing, encryption, and blinding)
Crypto.PublicKey.qNEW (Signature only)
======================== =============================================
+
+:undocumented: _DSA, _RSA, _fastmath, _slowmath, pubkey
"""
__all__ = ['RSA', 'DSA', 'ElGamal', 'qNEW']
diff --git a/lib/Crypto/PublicKey/qNEW.py b/lib/Crypto/PublicKey/qNEW.py
index fc1fd9b..2a8a4b8 100644
--- a/lib/Crypto/PublicKey/qNEW.py
+++ b/lib/Crypto/PublicKey/qNEW.py
@@ -24,6 +24,8 @@
# ===================================================================
#
+"""q-NEW public-key signature algorithm."""
+
__revision__ = "$Id$"
from Crypto.PublicKey import pubkey