package knownhosts

Import Path
	golang.org/x/crypto/ssh/knownhosts (on go.dev)

Dependency Relation
	imports 13 packages, and imported by one package

Involved Source Files Package knownhosts implements a parser for the OpenSSH known_hosts host key database, and provides utility functions for writing OpenSSH compliant known_hosts files.
Package-Level Type Names (total 10, in which 3 are exported)
/* sort exporteds by: | */
KeyError is returned if we did not find the key in the host key database, or there was a mismatch. Typically, in batch applications, this should be interpreted as failure. Interactive applications can offer an interactive prompt to the user. Want holds the accepted host keys. For each key algorithm, there can be one hostkey. If Want is empty, the host is unknown. If Want is non-empty, there was a mismatch, which can signify a MITM attack. (*T) Error() string *T : error
KnownKey represents a key declared in a known_hosts file. Filename string Key ssh.PublicKey Line int (*T) String() string *T : expvar.Var *T : fmt.Stringer
RevokedError is returned if we found a key that was revoked. Revoked KnownKey (*T) Error() string *T : error
Package-Level Functions (total 15, in which 4 are exported)
HashHostname hashes the given hostname. The hostname is not normalized before hashing.
Line returns a line to add append to the known_hosts files.
New creates a host key callback from the given OpenSSH host key files. The returned callback is for use in ssh.ClientConfig.HostKeyCallback. By preference, the key check operates on the hostname if available, i.e. if a server changes its IP address, the host key check will still succeed, even though a record of the new IP address is not available.
Normalize normalizes an address into the form used in known_hosts
Package-Level Constants (total 3, none are exported)