def verifyHostKey(transport, host, pubKey, fingerprint):
 actualHost = transport.factory.options['host']
 actualKey = keys.Key.fromString(pubKey)
 kh = KnownHostsFile.fromPath(FilePath((transport.factory.options['known-hosts'] or os.path.expanduser('~/.ssh/known_hosts'))))
 ui = ConsoleUI((lambda : _open('/dev/tty', 'r+b')))
 return kh.verifyHostKey(ui, actualHost, host, actualKey)

def verifyHostKey ( transport , host , pubKey , fingerprint ) : actualHost = transport . factory . options [ 'host' ] actualKey = keys . Key . fromString ( pubKey ) kh = KnownHostsFile . fromPath ( FilePath ( ( transport . factory . options [ 'known-hosts' ] or os . path . expanduser ( '~/.ssh/known_hosts' ) ) ) ) ui = ConsoleUI ( ( lambda : _open ( '/dev/tty' , 'r+b' ) ) ) return kh . verifyHostKey ( ui , actualHost , host , actualKey )
verify a hosts key .