Class SshHostKeyVerifier
- Namespace
- SshSharp
- Assembly
- SshSharp.dll
Decides whether to trust a server's host key. Use KnownHostsVerifier for OpenSSH known_hosts behaviour,
Pinned(params string[]) for fixed fingerprints or Pinned(params SshPublicKey[]) for fixed keys, or FromDelegate(Func<SshHostKeyContext, CancellationToken, ValueTask<bool>>) for your own logic.
public abstract class SshHostKeyVerifier
- Inheritance
-
SshHostKeyVerifier
- Derived
- Inherited Members
Methods
- FromDelegate(Func<SshHostKeyContext, CancellationToken, ValueTask<bool>>)
A verifier that calls
verify: true trusts the key.
- Pinned(params SshPublicKey[])
Trusts only these keys: the server's key must be one of them, byte for byte (for a host certificate, the certified key). Read them with Parse(string) from the server's
/etc/ssh/ssh_host_*_key.pubfiles.
- Pinned(params string[])
Trusts only keys with one of these OpenSSH SHA-256 fingerprints (
SHA256:..., asssh-keygen -lfprints).
- VerifyAsync(SshHostKeyContext, CancellationToken)
Decides whether to trust the key in
context.