Class KnownHostsEntry
One parsed known_hosts line.
public sealed class KnownHostsEntry
- Inheritance
-
KnownHostsEntry
- Inherited Members
Constructors
Properties
- Comment
The trailing comment, if any.
- HostPatterns
The raw host field: comma-separated patterns, or a single hashed host.
- IsHashed
Whether the host field is hashed (
|1|salt|hash).
- KeyType
The key type, for example
ssh-ed25519.
- PublicKey
The public key blob.
Methods
- FormatHost(string, int)
Formats a host and port the way
known_hostsstores them:host, or[host]:portfor non-22 ports.
- HashHost(string, int, ReadOnlySpan<byte>)
Creates a hashed host field (
|1|salt|hash) for a host and port.
- Matches(string, int)
Whether this entry applies to a host and port.
- ToLine()
Formats the entry as a
known_hostsline (no line terminator).