openssh_key.private_key_list.PublicPrivateKeyPair

class openssh_key.private_key_list.PublicPrivateKeyPair(public: openssh_key.key.PublicKey, private: openssh_key.key.PrivateKey)

Bases: NamedTuple

A public key and its corresponding private key.

__init__()

Methods

__init__()

count(value, /)

Return number of occurrences of value.

generate(key_type[, comment])

Generates a private key of the given type, with an optional comment for the private key.

index(value[, start, stop])

Return first index of value.

Attributes

private

The corresponding private key.

public

The public key.

count(value, /)

Return number of occurrences of value.

static generate(key_type, comment='', **kwargs)

Generates a private key of the given type, with an optional comment for the private key.

Parameters
  • key_type (str) – The OpenSSH name of the key type.

  • comment (str) – The comment for the private key. Default is empty string.

Return type

PublicPrivateKeyPair

Returns

A generated public key and its corresponding private key.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

private: openssh_key.key.PrivateKey

The corresponding private key.

public: openssh_key.key.PublicKey

The public key.