Method Add
Add(string, int, SshPublicKey, bool, string?, KnownHostsMarker)
Appends an entry for a host's key, as Add(string, int, string, ReadOnlySpan<byte>, bool, string?, KnownHostsMarker)
does with its type and blob. The key's own Comment is not written; pass comment for one.
public KnownHostsEntry Add(string host, int port, SshPublicKey key, bool hash = false, string? comment = null, KnownHostsMarker marker = KnownHostsMarker.None)
Parameters
hoststringThe host name or address.
portintThe port.
keySshPublicKeyThe host's key.
hashboolWhether to store the host hashed (
HashKnownHosts).commentstringAn optional comment.
markerKnownHostsMarkerAn optional marker.
Returns
Add(string, int, string, ReadOnlySpan<byte>, bool, string?, KnownHostsMarker)
Appends an entry for a host.
public KnownHostsEntry Add(string host, int port, string keyType, ReadOnlySpan<byte> publicKey, bool hash = false, string? comment = null, KnownHostsMarker marker = KnownHostsMarker.None)
Parameters
hoststringThe host name or address.
portintThe port.
keyTypestringThe key type, for example
ssh-ed25519.publicKeyReadOnlySpan<byte>The public key blob.
hashboolWhether to store the host hashed (
HashKnownHosts).commentstringAn optional comment.
markerKnownHostsMarkerAn optional marker.