Class DefaultNewHostKeysHandler

java.lang.Object
org.apache.sshd.client.config.DefaultNewHostKeysHandler
All Implemented Interfaces:
NewHostKeysHandler

public class DefaultNewHostKeysHandler extends Object implements NewHostKeysHandler
A default NewHostKeysHandler that registers the new host keys on the session.
Author:
Apache MINA SSHD Project
  • Constructor Details

    • DefaultNewHostKeysHandler

      public DefaultNewHostKeysHandler()
  • Method Details

    • receiveNewHostKeys

      public void receiveNewHostKeys(ClientSession session, Collection<PublicKey> hostKeys)
      Description copied from interface: NewHostKeysHandler
      Invoked when new keys have been received and verified.

      If this method updates the known_hosts file or other key database with the new keys, it is recommended to do so in a separate thread to avoid blocking the calling thread.

      Specified by:
      receiveNewHostKeys in interface NewHostKeysHandler
      Parameters:
      session - the ClientSession that received the keys; can be used to figure out which server sent these keys (via the session's host config entry or server address)
      hostKeys - the verified host keys received; never null and never containing null; may contain host certificates