class documentation
class PlainEntry(_BaseEntry): (source)
Constructors: PlainEntry.fromString(string)
, PlainEntry(hostnames, keyType, publicKey, comment)
Implements interfaces: twisted.conch.interfaces.IKnownHostEntry
A PlainEntry
is a representation of a plain-text entry in a known_hosts file.
Class Method | from |
Parse a plain-text entry in a known_hosts file, and return a corresponding PlainEntry . |
Method | __init__ |
Undocumented |
Method | matches |
Check to see if this entry matches a given hostname. |
Method | to |
Implement IKnownHostEntry.toString by recording the comma-separated hostnames, key type, and base-64 encoded key. |
Instance Variable | _hostnames |
the list of all host-names associated with this entry. |
Inherited from _BaseEntry
:
Method | matches |
Check to see if this entry matches a given key object. |
Instance Variable | comment |
Trailing garbage after the key line. |
Instance Variable | key |
The type of the key; either ssh-dss or ssh-rsa. |
Instance Variable | public |
The server public key indicated by this line. |
Parse a plain-text entry in a known_hosts file, and return a corresponding PlainEntry
.
Parameters | |
string:bytes | a space-separated string formatted like "hostname key-type base64-key-data comment". |
Returns | |
PlainEntry | an IKnownHostEntry representing the hostname and key in the input line. |
Raises | |
DecodeError | if the key is not valid encoded as valid base64. |
InvalidEntry | if the entry does not have the right number of elements and is therefore invalid. |
BadKeyError | if the key, once decoded from base64, is not actually an SSH key. |
def __init__(self, hostnames:
list[ bytes]
, keyType: bytes
, publicKey: Key
, comment: bytes
):
(source)
¶
Undocumented
Implement IKnownHostEntry.toString
by recording the comma-separated hostnames, key type, and base-64 encoded key.
Returns | |
bytes | The string representation of this entry, with unhashed hostname information. |