tlslite.utils.python_rsakey module

Pure-Python RSA implementation.

class tlslite.utils.python_rsakey.Python_RSAKey(n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0)

Bases: tlslite.utils.rsakey.RSAKey

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

Create a new RSA key.

If n and e are passed in, the new key will be initialized.

Parameters:
  • n (int) – RSA modulus.
  • e (int) – RSA public exponent.
acceptsPassword()

Return True if the write() method accepts a password for use in encrypting the private key.

Return type:bool
static generate(bits)

Generate a new key with the specified bit length.

Return type:RSAKey
hasPrivateKey()

Return whether or not this key has a private component.

Return type:bool
static parsePEM(s, passwordCallback=None)

Parse a string containing a PEM-encoded <privateKey>.