tlslite.utils.openssl_rsakey module¶
OpenSSL/M2Crypto RSA implementation.
-
class
tlslite.utils.openssl_rsakey.
OpenSSL_RSAKey
(n=0, e=0, key_type='rsa')¶ Bases:
tlslite.utils.rsakey.RSAKey
-
__del__
()¶
-
__getattr__
(name)¶
-
__init__
(n=0, e=0, key_type='rsa')¶ Create a new RSA key.
If n and e are passed in, the new key will be initialized.
-
__module__
= 'tlslite.utils.openssl_rsakey'¶
-
acceptsPassword
()¶ Return True if the write() method accepts a password for use in encrypting the private key.
- Return type
-
static
generate
(bits, key_type='rsa')¶ Generate a new key with the specified bit length.
- Return type
RSAKey
-
static
parse
(s, passwordCallback=None)¶
-
-
tlslite.utils.openssl_rsakey.
bytes_to_int
(bytes, byteorder, *, signed=False)¶ Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.
- signed
Indicates whether two’s complement is used to represent the integer.
-
tlslite.utils.openssl_rsakey.
password_callback
(v, prompt1='Enter private key passphrase:', prompt2='Verify passphrase:')¶