The public key of a SSH server. More...
Public Member Functions | |
HostKey (String host, byte[] key) throws JSchException | |
creates a host key by guessing it's type from the data. | |
HostKey (String host, int type, byte[] key) throws JSchException | |
creates a host key with given type. | |
String | getHost () |
returns the name of the host. | |
String | getType () |
returns the type of the key. | |
String | getKey () |
returns a base64-representation of the key. | |
String | getFingerPrint (JSch jsch) |
returns the key's fingerprint (i.e. | |
Static Public Attributes | |
static final int | SSHDSS = 1 |
Type constant for a DSS key. | |
static final int | SSHRSA = 2 |
Type constant for a DSA key. | |
Protected Attributes | |
String | host |
the host list | |
int | type |
the type of this key. | |
byte[] | key |
the key data | |
Static Protected Attributes | |
static final int | GUESS = 0 |
Type constant for "try to guess the type". | |
Package Functions | |
boolean | isMatched (String _host) |
checks if the key applies to some host. | |
Static Package Attributes | |
static final int | UNKNOWN = 3 |
Type constant for a key of unknown type. | |
Private Member Functions | |
boolean | isIncluded (String _host) |
Static Private Attributes | |
static final byte[] | sshdss = Util.str2byte("ssh-dss") |
static final byte[] | sshrsa = Util.str2byte("ssh-rsa") |
The public key of a SSH server.
This class encapsulates a list of host names and the public key of this host in one object.
Definition at line 39 of file HostKey.java.
com.jcraft.jsch.HostKey.HostKey | ( | String | host, | |
byte[] | key | |||
) | throws JSchException |
creates a host key by guessing it's type from the data.
host | the host name (or names, as a comma-separated list) | |
key | the key data. |
Definition at line 64 of file HostKey.java.
References com.jcraft.jsch.HostKey.GUESS, com.jcraft.jsch.HostKey.host, and com.jcraft.jsch.HostKey.key.
com.jcraft.jsch.HostKey.HostKey | ( | String | host, | |
int | type, | |||
byte[] | key | |||
) | throws JSchException |
creates a host key with given type.
host | the host name (or names, as a comma-separated list) | |
type | a constant for the type, one of SSHDSS or SSHRSA. (Some other types are used internally.) | |
key | the key data. |
Definition at line 76 of file HostKey.java.
References com.jcraft.jsch.HostKey.GUESS, com.jcraft.jsch.HostKey.host, com.jcraft.jsch.HostKey.key, com.jcraft.jsch.HostKey.SSHDSS, com.jcraft.jsch.HostKey.SSHRSA, and com.jcraft.jsch.HostKey.type.
String com.jcraft.jsch.HostKey.getFingerPrint | ( | JSch | jsch | ) |
returns the key's fingerprint (i.e.
a lowercase hexadecimal representation of the MD5 of the key.)
Definition at line 115 of file HostKey.java.
References com.jcraft.jsch.HostKey.key.
String com.jcraft.jsch.HostKey.getHost | ( | ) |
returns the name of the host.
Definition at line 92 of file HostKey.java.
References com.jcraft.jsch.HostKey.host.
Referenced by com.jcraft.jsch.KnownHosts.add(), com.jcraft.jsch.KnownHosts.dump(), and com.jcraft.jsch.KnownHosts.remove().
String com.jcraft.jsch.HostKey.getKey | ( | ) |
returns a base64-representation of the key.
Definition at line 107 of file HostKey.java.
References com.jcraft.jsch.HostKey.key.
Referenced by com.jcraft.jsch.KnownHosts.dump().
String com.jcraft.jsch.HostKey.getType | ( | ) |
returns the type of the key.
Definition at line 97 of file HostKey.java.
References com.jcraft.jsch.HostKey.sshdss, com.jcraft.jsch.HostKey.SSHDSS, com.jcraft.jsch.HostKey.sshrsa, com.jcraft.jsch.HostKey.SSHRSA, and com.jcraft.jsch.HostKey.type.
Referenced by com.jcraft.jsch.KnownHosts.dump(), com.jcraft.jsch.KnownHosts.getHostKey(), and com.jcraft.jsch.KnownHosts.remove().
boolean com.jcraft.jsch.HostKey.isIncluded | ( | String | _host | ) | [private] |
Definition at line 132 of file HostKey.java.
References com.jcraft.jsch.HostKey.host.
Referenced by com.jcraft.jsch.HostKey.isMatched().
boolean com.jcraft.jsch.HostKey.isMatched | ( | String | _host | ) | [package] |
checks if the key applies to some host.
Reimplemented in com.jcraft.jsch.KnownHosts.HashedHostKey.
Definition at line 128 of file HostKey.java.
References com.jcraft.jsch.HostKey.isIncluded().
Referenced by com.jcraft.jsch.KnownHosts.add(), com.jcraft.jsch.KnownHosts.check(), com.jcraft.jsch.KnownHosts.getHostKey(), and com.jcraft.jsch.KnownHosts.remove().
final int com.jcraft.jsch.HostKey.GUESS = 0 [static, protected] |
Type constant for "try to guess the type".
Definition at line 44 of file HostKey.java.
Referenced by com.jcraft.jsch.KnownHosts.HashedHostKey.HashedHostKey(), and com.jcraft.jsch.HostKey.HostKey().
String com.jcraft.jsch.HostKey.host [protected] |
the host list
Definition at line 53 of file HostKey.java.
Referenced by com.jcraft.jsch.HostKey.getHost(), com.jcraft.jsch.KnownHosts.HashedHostKey.hash(), com.jcraft.jsch.KnownHosts.HashedHostKey.HashedHostKey(), com.jcraft.jsch.HostKey.HostKey(), com.jcraft.jsch.HostKey.isIncluded(), and com.jcraft.jsch.KnownHosts.remove().
byte [] com.jcraft.jsch.HostKey.key [protected] |
the key data
Definition at line 57 of file HostKey.java.
Referenced by com.jcraft.jsch.KnownHosts.add(), com.jcraft.jsch.KnownHosts.check(), com.jcraft.jsch.HostKey.getFingerPrint(), com.jcraft.jsch.HostKey.getKey(), com.jcraft.jsch.KnownHosts.HashedHostKey.HashedHostKey(), com.jcraft.jsch.HostKey.HostKey(), and com.jcraft.jsch.KnownHosts.remove().
final int com.jcraft.jsch.HostKey.SSHDSS = 1 [static] |
Type constant for a DSS key.
Definition at line 46 of file HostKey.java.
Referenced by com.jcraft.jsch.HostKey.getType(), and com.jcraft.jsch.HostKey.HostKey().
final byte [] com.jcraft.jsch.HostKey.sshdss = Util.str2byte("ssh-dss") [static, private] |
Definition at line 40 of file HostKey.java.
Referenced by com.jcraft.jsch.HostKey.getType().
final int com.jcraft.jsch.HostKey.SSHRSA = 2 [static] |
Type constant for a DSA key.
Definition at line 48 of file HostKey.java.
Referenced by com.jcraft.jsch.HostKey.getType(), and com.jcraft.jsch.HostKey.HostKey().
final byte [] com.jcraft.jsch.HostKey.sshrsa = Util.str2byte("ssh-rsa") [static, private] |
Definition at line 41 of file HostKey.java.
Referenced by com.jcraft.jsch.HostKey.getType().
int com.jcraft.jsch.HostKey.type [protected] |
the type of this key.
Definition at line 55 of file HostKey.java.
Referenced by com.jcraft.jsch.KnownHosts.add(), com.jcraft.jsch.KnownHosts.check(), com.jcraft.jsch.KnownHosts.getHostKey(), com.jcraft.jsch.HostKey.getType(), com.jcraft.jsch.KnownHosts.HashedHostKey.HashedHostKey(), and com.jcraft.jsch.HostKey.HostKey().
final int com.jcraft.jsch.HostKey.UNKNOWN = 3 [static, package] |
Type constant for a key of unknown type.
Definition at line 50 of file HostKey.java.