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()
HostKeyRepository
getKnownHostsRepositoryID
在接口中 HostKeyRepository
public int check(java.lang.String host, byte[] key)
HostKeyRepository
host
is included with the key
.check
在接口中 HostKeyRepository
HostKeyRepository.NOT_INCLUDED
,
HostKeyRepository.OK
,
HostKeyRepository.CHANGED
public void add(HostKey hostkey, UserInfo userinfo)
HostKeyRepository
hostkey
add
在接口中 HostKeyRepository
hostkey
- a host key to be addeduserinfo
- a user interface for showing messages or promping inputs.UserInfo
public HostKey[] getHostKey()
HostKeyRepository
public HostKey[] getHostKey(java.lang.String host, java.lang.String type)
HostKeyRepository
getHostKey
在接口中 HostKeyRepository
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.public void remove(java.lang.String host, java.lang.String type)
HostKeyRepository
host
, type
.public void remove(java.lang.String host, java.lang.String type, byte[] key)
HostKeyRepository
host
, type
and key
.remove
在接口中 HostKeyRepository
protected void sync() throws java.io.IOException
java.io.IOException
protected void sync(java.lang.String foo) throws java.io.IOException
java.io.IOException