Interface HostKeyVerifier

    • Method Summary

      Modifier and Type Method Description
      boolean verify​(java.lang.String hostname, int port, java.security.PublicKey key)
      This callback is invoked when the server's host key needs to be verified.
    • Method Detail

      • verify

        boolean verify​(java.lang.String hostname,
                       int port,
                       java.security.PublicKey key)
        This callback is invoked when the server's host key needs to be verified. The return value indicates to the caller whether the SSH connection should proceed.

        Note: host key verification is the basis for security in SSH, therefore exercise due caution in implementing!

        Parameters:
        hostname - remote hostname
        port - remote port
        key - host key of server
        Returns:
        true if key is acceptable, false otherwise