Table of Contents

Method HashHost

Namespace
SshSharp.Config
Assembly
SshSharp.dll

HashHost(string, int, ReadOnlySpan<byte>)

Creates a hashed host field (|1|salt|hash) for a host and port.

[SuppressMessage("Security", "CA5350", Justification = "HMAC-SHA1 is mandated by the OpenSSH hashed known_hosts format; it is not used for security of the connection.")]
public static string HashHost(string host, int port, ReadOnlySpan<byte> salt = default)

Parameters

host string

The host name or address.

port int

The port.

salt ReadOnlySpan<byte>

The 20-byte salt; random when omitted.

Returns

string