Table of Contents

Class KnownHostsEntry

Namespace
SshSharp.Config
Assembly
SshSharp.dll

One parsed known_hosts line.

public sealed class KnownHostsEntry
Inheritance
KnownHostsEntry
Inherited Members

Constructors

KnownHostsEntry(string, string, ReadOnlyMemory<byte>, KnownHostsMarker, string?)

Creates an entry.

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.

Marker

The marker (@cert-authority, @revoked) or None.

PublicKey

The public key blob.

Methods

FormatHost(string, int)

Formats a host and port the way known_hosts stores them: host, or [host]:port for 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_hosts line (no line terminator).