Exscript.key module

Represents a private key.

class Exscript.key.PrivateKey(keytype='rsa')[source]

Bases: future.types.newobject.newobject

Represents a cryptographic key, and may be used to authenticate using Exscript.protocols.


Constructor. Supported key types are provided by their respective protocol adapters and can be retrieved from the PrivateKey.keytypes class attribute.

Parameters:keytype (string) – The key type.
static from_file(filename, password='', keytype=None)[source]

Returns a new PrivateKey instance with the given attributes. If keytype is None, we attempt to automatically detect the type.

  • filename (string) – The key file name.
  • password (string) – The key password.
  • keytype (string) – The key type.
Return type:



The new key.


Returns the name of the key file.

Return type:string
Returns:The key password.

Returns the password for the key.

Return type:string
Returns:The key password.

Returns the type of the key, e.g. RSA or DSA.

Return type:string
Returns:The key type
keytypes = set([u'dss', u'rsa'])

Sets the name of the key file to use.

Parameters:filename (string) – The key filename.

Defines the password used for decrypting the key.

Parameters:password (string) – The key password.