public class KnownHosts extends Object implements HostKeyRepository
CHANGED, NOT_INCLUDED, OK| Modifier and Type | Method and Description |
|---|---|
void |
add(HostKey hostkey,
UserInfo userinfo)
Adds a host key
hostkey |
int |
check(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(String host,
String type)
Retuns a list for host keys managed in this repository.
|
String |
getKnownHostsRepositoryID()
Returns id of this repository.
|
void |
remove(String host,
String type)
Removes a host key if there exists mached key with
host, type. |
void |
remove(String host,
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(String foo) |
public String getKnownHostsRepositoryID()
HostKeyRepositorygetKnownHostsRepositoryID in interface HostKeyRepositorypublic int check(String host, byte[] key)
HostKeyRepositoryhost is included with the key.check in interface HostKeyRepositoryHostKeyRepository.NOT_INCLUDED,
HostKeyRepository.OK,
HostKeyRepository.CHANGEDpublic void add(HostKey hostkey, UserInfo userinfo)
HostKeyRepositoryhostkeyadd in interface HostKeyRepositoryhostkey - a host key to be addeduserinfo - a user interface for showing messages or promping inputs.UserInfopublic HostKey[] getHostKey()
HostKeyRepositorygetHostKey in interface HostKeyRepositoryHostKeyRepository.getHostKey(String host, String type)public HostKey[] getHostKey(String host, String type)
HostKeyRepositorygetHostKey in interface 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(String host, String type)
HostKeyRepositoryhost, type.remove in interface HostKeyRepositoryHostKeyRepository.remove(String host, String type, byte[] key)public void remove(String host, String type, byte[] key)
HostKeyRepositoryhost, type and key.remove in interface HostKeyRepositoryprotected void sync()
throws IOException
IOExceptionprotected void sync(String foo) throws IOException
IOExceptionCopyright © 2017–2019 Eclipse Foundation. All rights reserved.