Interface HostKeyRepository


public interface HostKeyRepository
  • Field Details

  • Method Details

    • check

      int check(String host, byte[] key)
      Checks if host is included with the key.
      Returns:
      #NOT_INCLUDED, #OK or #CHANGED
      See Also:
    • add

      void add(HostKey hostkey, UserInfo ui)
      Adds a host key hostkey
      Parameters:
      hostkey - a host key to be added
      ui - a user interface for showing messages or promping inputs.
      See Also:
    • remove

      void remove(String host, String type)
      Removes host keys matching host and type.

      When both arguments are non-null, entries with a non-empty marker are preserved. A null host clears the repository, while a null type removes all keys matching host, including marked entries.

      See Also:
    • remove

      void remove(String host, String type, byte[] key)
      Removes host keys matching host, type and key.

      When host and type are non-null and key is null, entries with a non-empty marker are preserved. A non-null matching key also removes marked entries. A null host clears the repository, while a null type removes all keys matching host, including marked entries.

    • getKnownHostsRepositoryID

      String getKnownHostsRepositoryID()
      Returns id of this repository.
      Returns:
      identity in String
    • getHostKey

      HostKey[] getHostKey()
      Retuns a list for host keys managed in this repository.
      See Also:
    • getHostKey

      HostKey[] getHostKey(String host, String type)
      Retuns a list for host keys managed in this repository.
      Parameters:
      host - a hostname used in searching host keys. If null is given, every host key will be listed.
      type - a key type used in searching host keys, and it should be "ssh-dss" or "ssh-rsa". If null is given, a key type type will not be ignored.