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

Class PyCrypto_RSAKey

RSAKey --+
         |
        PyCrypto_RSAKey


Method Summary
  __init__(self, n, e)
Create a new RSA key.
  __getattr__(self, name)
  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.
str writeXMLPublicKey(self, indent)
Return a string containing the key.
    Inherited from RSAKey
int __len__(self)
Return the length of this key in bits.
bool acceptsPassword(self)
Return True if the write() method accepts a password for use in encrypting the private key.
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.
str write(self, password)
Return a string containing the key.

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)

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)

Generated by Epydoc 2.0 on Sun Mar 21 00:04:59 2004 http://epydoc.sf.net