5.5.17.2. PrivateKey methods

MethodDescription
__init__(self, key, passphrase) Load a private key from a string, and access it using its passphrase
fromFile(key_file_path, passphrase) Load a private key from a file, and access it using its passphrase

Table 5.56. Method summary

Method __init__(self, key, passphrase)

Initializes a PrivateKey instance by loading a private key from a string, and accesses it using its passphrase. To load a private key from a file, use the PrivateKey.fromFile method.

Arguments of __init__
key_file_path (certificate)
Default: n/a
The path and filename to the private key file. The private key must be in PEM format.

passphrase (string)
Default: None
Passphrase used to access the private key specified in key_file_path.

Method fromFile(key_file_path, passphrase)

Initializes a PrivateKey instance by loading a private key from a file, and accesses it using its passphrase.

Arguments of fromFile
key_file_path (certificate)
Default: n/a
The path and filename to the private key file. The private key must be in PEM format.

passphrase (string)
Default: None
Passphrase used to access the private key specified in key_file_path.