gdata.tlslite.utils.PyCrypto_RSAKey
index
/usr/lib/python2.7/dist-packages/gdata/tlslite/utils/PyCrypto_RSAKey.py

PyCrypto RSA implementation.

 
Modules
       
Crypto
Crypto.PublicKey.RSA
array
base64
binascii
math
os
sys
traceback

 
Classes
       
gdata.tlslite.utils.RSAKey.RSAKey
PyCrypto_RSAKey

 
class PyCrypto_RSAKey(gdata.tlslite.utils.RSAKey.RSAKey)
     Methods defined here:
__getattr__(self, name)
__init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0)
hasPrivateKey(self)
hash(self)
writeXMLPublicKey(self, indent='')

Static methods defined here:
generate(bits)

Methods inherited from gdata.tlslite.utils.RSAKey.RSAKey:
__len__(self)
Return the length of this key in bits.
 
@rtype: int
acceptsPassword(self)
Return True if the write() method accepts a password for use
in encrypting the private key.
 
@rtype: bool
decrypt(self, encBytes)
Decrypt the passed-in bytes.
 
This requires the key to have a private component.  It performs
PKCS1 decryption of the passed-in data.
 
@type encBytes: L{array.array} of unsigned bytes
@param encBytes: The value which will be decrypted.
 
@rtype: L{array.array} of unsigned bytes or None.
@return: A PKCS1 decryption of the passed-in data or None if
the data is not properly formatted.
encrypt(self, bytes)
Encrypt the passed-in bytes.
 
This performs PKCS1 encryption of the passed-in data.
 
@type bytes: L{array.array} of unsigned bytes
@param bytes: The value which will be encrypted.
 
@rtype: L{array.array} of unsigned bytes.
@return: A PKCS1 encryption of the passed-in data.
getSigningAlgorithm(self)
Return the cryptoID sigAlgo value corresponding to this key.
 
@rtype: str
hashAndSign(self, bytes)
Hash and sign the passed-in bytes.
 
This requires the key to have a private component.  It performs
a PKCS1-SHA1 signature on the passed-in data.
 
@type bytes: str or L{array.array} of unsigned bytes
@param bytes: The value which will be hashed and signed.
 
@rtype: L{array.array} of unsigned bytes.
@return: A PKCS1-SHA1 signature on the passed-in data.
hashAndVerify(self, sigBytes, bytes)
Hash and verify the passed-in bytes with the signature.
 
This verifies a PKCS1-SHA1 signature on the passed-in data.
 
@type sigBytes: L{array.array} of unsigned bytes
@param sigBytes: A PKCS1-SHA1 signature.
 
@type bytes: str or L{array.array} of unsigned bytes
@param bytes: The value which will be hashed and verified.
 
@rtype: bool
@return: Whether the signature matches the passed-in data.
sign(self, bytes)
Sign the passed-in bytes.
 
This requires the key to have a private component.  It performs
a PKCS1 signature on the passed-in data.
 
@type bytes: L{array.array} of unsigned bytes
@param bytes: The value which will be signed.
 
@rtype: L{array.array} of unsigned bytes.
@return: A PKCS1 signature on the passed-in data.
verify(self, sigBytes, bytes)
Verify the passed-in bytes with the signature.
 
This verifies a PKCS1 signature on the passed-in data.
 
@type sigBytes: L{array.array} of unsigned bytes
@param sigBytes: A PKCS1 signature.
 
@type bytes: L{array.array} of unsigned bytes
@param bytes: The value which will be verified.
 
@rtype: bool
@return: Whether the signature matches the passed-in data.
write(self, password=None)
Return a string containing the key.
 
@rtype: str
@return: A string describing the key, in whichever format (PEM
or XML) is native to the implementation.

 
Functions
       
sha1 = openssl_sha1(...)
Returns a sha1 hash object; optionally initialized with a string

 
Data
        cryptlibpyLoaded = False
gmpyLoaded = False
m2cryptoLoaded = False
prngName = 'os.urandom'
pycryptoLoaded = True
sieve = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, ...]