public class KnownHosts extends java.lang.Object implements HostKeyRepository
CHANGED, NOT_INCLUDED, OK| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(HostKey hostkey,
UserInfo userinfo)
Adds a host key
hostkey |
int |
check(java.lang.String host,
byte[] key)
Checks if
host is included with the key. |
HostKey[] |
getHostKey()
Retuns a list for host keys managed in this repository.
|
HostKey[] |
getHostKey(java.lang.String host,
java.lang.String type)
Retuns a list for host keys managed in this repository.
|
java.lang.String |
getKnownHostsRepositoryID()
Returns id of this repository.
|
void |
remove(java.lang.String host,
java.lang.String type)
Removes a host key if there exists mached key with
host, type. |
void |
remove(java.lang.String host,
java.lang.String type,
byte[] key)
Removes a host key if there exists a matched key with
host, type and key. |
protected void |
sync() |
protected void |
sync(java.lang.String foo) |
public java.lang.String getKnownHostsRepositoryID()
HostKeyRepositorygetKnownHostsRepositoryID 在接口中 HostKeyRepositorypublic int check(java.lang.String host,
byte[] key)
HostKeyRepositoryhost is included with the key.check 在接口中 HostKeyRepositoryHostKeyRepository.NOT_INCLUDED,
HostKeyRepository.OK,
HostKeyRepository.CHANGEDpublic void add(HostKey hostkey, UserInfo userinfo)
HostKeyRepositoryhostkeyadd 在接口中 HostKeyRepositoryhostkey - a host key to be addeduserinfo - a user interface for showing messages or promping inputs.UserInfopublic HostKey[] getHostKey()
HostKeyRepositorypublic HostKey[] getHostKey(java.lang.String host, java.lang.String type)
HostKeyRepositorygetHostKey 在接口中 HostKeyRepositoryhost - 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.public void remove(java.lang.String host,
java.lang.String type)
HostKeyRepositoryhost, type.public void remove(java.lang.String host,
java.lang.String type,
byte[] key)
HostKeyRepositoryhost, type and key.remove 在接口中 HostKeyRepositoryprotected void sync()
throws java.io.IOException
java.io.IOExceptionprotected void sync(java.lang.String foo)
throws java.io.IOException
java.io.IOException