interface documentation

A IKnownHostEntry is an entry in an OpenSSH-formatted known_hosts file.

Present Since
8.2
Method matchesHost Return True if this entry matches the given hostname, False otherwise.
Method matchesKey Return True if this entry matches the given Key object, False otherwise.
Method toString No summary
def matchesHost(hostname: bytes) -> bool: (source)

Return True if this entry matches the given hostname, False otherwise.

Note that this does no name resolution; if you want to match an IP address, you have to resolve it yourself, and pass it in as a dotted quad string.

Parameters
hostname:bytesThe hostname to match against.
Returns
boolUndocumented
def matchesKey(key: Key) -> bool: (source)

Return True if this entry matches the given Key object, False otherwise.

Parameters
key:KeyThe key object to match against.
Returns
boolUndocumented
def toString() -> bytes: (source)
Returns
bytesa serialized string representation of this entry, suitable for inclusion in a known_hosts file. (Newline not included.)