Package com.jcraft.jsch
Class KnownHosts
java.lang.Object
com.jcraft.jsch.KnownHosts
- All Implemented Interfaces:
HostKeyRepository
-
Field Summary
Fields inherited from interface com.jcraft.jsch.HostKeyRepository
CHANGED, NOT_INCLUDED, OK -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a host keyhostkeyintChecks ifhostis included with thekey.HostKey[]Retuns a list for host keys managed in this repository.HostKey[]getHostKey(String host, String type) Retuns a list for host keys managed in this repository.Returns id of this repository.voidRemoves a host key if there exists mached key withhost,type.voidRemoves a host key if there exists a matched key withhost,typeandkey.protected voidsync()protected void
-
Method Details
-
getKnownHostsRepositoryID
Description copied from interface:HostKeyRepositoryReturns id of this repository.- Specified by:
getKnownHostsRepositoryIDin interfaceHostKeyRepository- Returns:
- identity in String
-
check
Description copied from interface:HostKeyRepositoryChecks ifhostis included with thekey.- Specified by:
checkin interfaceHostKeyRepository- Returns:
- #NOT_INCLUDED, #OK or #CHANGED
- See Also:
-
add
Description copied from interface:HostKeyRepositoryAdds a host keyhostkey- Specified by:
addin interfaceHostKeyRepository- Parameters:
hostkey- a host key to be addeduserinfo- a user interface for showing messages or promping inputs.- See Also:
-
getHostKey
Description copied from interface:HostKeyRepositoryRetuns a list for host keys managed in this repository.- Specified by:
getHostKeyin interfaceHostKeyRepository- See Also:
-
getHostKey
Description copied from interface:HostKeyRepositoryRetuns a list for host keys managed in this repository.- Specified by:
getHostKeyin interfaceHostKeyRepository- Parameters:
host- a hostname used in searching host keys. Ifnullis 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". Ifnullis given, a key type type will not be ignored.
-
remove
Description copied from interface:HostKeyRepositoryRemoves a host key if there exists mached key withhost,type.- Specified by:
removein interfaceHostKeyRepository- See Also:
-
remove
Description copied from interface:HostKeyRepositoryRemoves a host key if there exists a matched key withhost,typeandkey.- Specified by:
removein interfaceHostKeyRepository
-
sync
- Throws:
IOException
-
sync
- Throws:
IOException
-