Package com.jcraft.jsch
Interface HostKeyRepository
- All Known Implementing Classes:
KnownHosts
public interface HostKeyRepository
-
Field Summary
Fields Modifier and Type Field Description static intCHANGEDstatic intNOT_INCLUDEDstatic intOK -
Method Summary
Modifier and Type Method Description voidadd(HostKey hostkey, UserInfo ui)Adds a host keyhostkeyintcheck(java.lang.String host, byte[] key)Checks ifhostis included with thekey.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.StringgetKnownHostsRepositoryID()Returns id of this repository.voidremove(java.lang.String host, java.lang.String type)Removes a host key if there exists mached key withhost,type.voidremove(java.lang.String host, java.lang.String type, byte[] key)Removes a host key if there exists a matched key withhost,typeandkey.
-
Field Details
-
OK
static final int OK- See Also:
- Constant Field Values
-
NOT_INCLUDED
static final int NOT_INCLUDED- See Also:
- Constant Field Values
-
CHANGED
static final int CHANGED- See Also:
- Constant Field Values
-
-
Method Details
-
check
int check(java.lang.String host, byte[] key)Checks ifhostis included with thekey.- Returns:
- #NOT_INCLUDED, #OK or #CHANGED
- See Also:
NOT_INCLUDED,OK,CHANGED
-
add
Adds a host keyhostkey- Parameters:
hostkey- a host key to be addedui- a user interface for showing messages or promping inputs.- See Also:
UserInfo
-
remove
void remove(java.lang.String host, java.lang.String type)Removes a host key if there exists mached key withhost,type. -
remove
void remove(java.lang.String host, java.lang.String type, byte[] key)Removes a host key if there exists a matched key withhost,typeandkey. -
getKnownHostsRepositoryID
java.lang.String getKnownHostsRepositoryID()Returns id of this repository.- Returns:
- identity in String
-
getHostKey
HostKey[] getHostKey()Retuns a list for host keys managed in this repository.- See Also:
getHostKey(String host, String type)
-
getHostKey
Retuns a list for host keys managed in this repository.- 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.
-