Package tlslite :: Package utils :: Module Python_RSAKey :: Class Python_RSAKey
[show private | hide private]
[frames | no frames]

Class Python_RSAKey

RSAKey --+
         |
        Python_RSAKey


Method Summary
  __init__(self, n, e)
Create a new RSA key.
bool acceptsPassword(self)
Return True if the write() method accepts a password for use in encrypting the private key.
  generate(bits)
(Static method)
str hash(self)
Return the cryptoID <keyHash> value corresponding to this key.
bool hasPrivateKey(self)
Return whether or not this key has a private component.
  parsePEM(s, passwordCallback)
Parse a string containing a <privateKey> or <publicKey>, or PEM-encoded key. (Static method)
  parseXML(s)
(Static method)
  write(self, indent)
str writeXMLPublicKey(self, indent)
Return a string containing the key.
    Inherited from RSAKey
int __len__(self)
Return the length of this key in bits.
array.array of unsigned bytes or None. decrypt(self, encBytes)
Decrypt the passed-in bytes.
array.array of unsigned bytes. encrypt(self, bytes)
Encrypt the passed-in bytes.
str getSigningAlgorithm(self)
Return the cryptoID sigAlgo value corresponding to this key.
array.array of unsigned bytes. hashAndSign(self, bytes)
Hash and sign the passed-in bytes.
bool hashAndVerify(self, sigBytes, bytes)
Hash and verify the passed-in bytes with the signature.
array.array of unsigned bytes. sign(self, bytes)
Sign the passed-in bytes.
bool verify(self, sigBytes, bytes)
Verify the passed-in bytes with the signature.

Instance Method Details

__init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0)
(Constructor)

Create a new RSA key.

If n and e are passed in, the new key will be initialized.
Parameters:
n - RSA modulus.
           (type=int)
e - RSA public exponent.
           (type=int)
Overrides:
tlslite.utils.RSAKey.RSAKey.__init__ (inherited documentation)

acceptsPassword(self)

Return True if the write() method accepts a password for use in encrypting the private key.
Returns:
bool
Overrides:
tlslite.utils.RSAKey.RSAKey.acceptsPassword (inherited documentation)

hash(self)

Return the cryptoID <keyHash> value corresponding to this key.
Returns:
str
Overrides:
tlslite.utils.RSAKey.RSAKey.hash (inherited documentation)

hasPrivateKey(self)

Return whether or not this key has a private component.
Returns:
bool
Overrides:
tlslite.utils.RSAKey.RSAKey.hasPrivateKey (inherited documentation)

writeXMLPublicKey(self, indent='')

Return a string containing the key.
Returns:
A string describing the public key, in XML format.
           (type=str)
Overrides:
tlslite.utils.RSAKey.RSAKey.writeXMLPublicKey (inherited documentation)

Static Method Details

parsePEM(s, passwordCallback=None)

Parse a string containing a <privateKey> or <publicKey>, or PEM-encoded key.

Generated by Epydoc 2.0 on Mon Feb 21 21:56:53 2005 http://epydoc.sf.net