Package com.jcraft.jsch
Class KnownHosts
java.lang.Object
com.jcraft.jsch.KnownHosts
- All Implemented Interfaces:
HostKeyRepository
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final byte[]private MACprivate JSchprivate Stringprivate Vectorprivate static final byte[]Fields inherited from interface com.jcraft.jsch.HostKeyRepository
CHANGED, NOT_INCLUDED, OK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a host keyhostkeyprivate voidaddInvalidLine(String line) intChecks ifhostis included with thekey.(package private) HostKeycreateHashedHostKey(String host, byte[] key) private StringdeleteSubString(String hosts, String host) (package private) voiddump(OutputStream out) private MACHostKey[]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.(package private) StringReturns 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.(package private) voidsetKnownHosts(InputStream input) (package private) voidsetKnownHosts(String filename) protected voidsync()protected void
-
Field Details
-
_known_hosts
- See Also:
-
jsch
-
known_hosts
-
pool
-
hmacsha1
-
space
private static final byte[] space -
cr
private static final byte[] cr
-
-
Constructor Details
-
KnownHosts
KnownHosts(JSch jsch)
-
-
Method Details
-
setKnownHosts
- Throws:
JSchException
-
setKnownHosts
- Throws:
JSchException
-
addInvalidLine
- Throws:
JSchException
-
getKnownHostsFile
String getKnownHostsFile() -
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
-
dump
- Throws:
IOException
-
deleteSubString
-
getHMACSHA1
-
createHashedHostKey
- Throws:
JSchException
-