KnownHostsVerifier

class KnownHostsVerifier(file: File, hostname: String, port: Int = 22) : HostKeyVerifier(source)

A host key verifier that reads from an OpenSSH-style known_hosts file.

Currently supports:

  • Plain hostnames (no hashed hosts yet)

  • Wildcards (* and ?) in hostnames

  • Multiple keys per host

Parameters

file

The known_hosts file to read.

Constructors

Link copied to clipboard
constructor(file: File, hostname: String, port: Int = 22)

Functions

Link copied to clipboard
open suspend fun addKeys(keys: List<PublicKey>)
Link copied to clipboard
open suspend fun removeKeys(keys: List<PublicKey>)
Link copied to clipboard
open suspend override fun verify(key: PublicKey): Boolean

Verify the server's host key.