public class HostKey extends Object
HostKeyRepository
Modifier and Type | Field and Description |
---|---|
protected String |
comment |
static int |
ECDSA256 |
static int |
ECDSA384 |
static int |
ECDSA521 |
protected static int |
GUESS
Type constant for "try to guess the type".
|
protected String |
host
the host list
|
protected byte[] |
key
the key data
|
protected String |
marker |
static int |
SSHDSS
Type constant for a DSS key.
|
static int |
SSHRSA
Type constant for a DSA key.
|
protected int |
type
the type of this key.
|
Constructor and Description |
---|
HostKey(String host,
byte[] key)
creates a host key by guessing it's type from the data.
|
HostKey(String host,
int type,
byte[] key)
creates a host key with given type.
|
HostKey(String host,
int type,
byte[] key,
String comment) |
HostKey(String marker,
String host,
int type,
byte[] key,
String comment) |
Modifier and Type | Method and Description |
---|---|
String |
getComment() |
String |
getFingerPrint(JSch jsch)
returns the key's fingerprint (i.e. a lowercase hexadecimal
representation of the MD5 of the key.)
|
String |
getHost()
returns the name of the host.
|
String |
getKey()
returns a base64-representation of the key.
|
String |
getMarker() |
String |
getType()
returns the type of the key.
|
protected static int |
name2type(String name) |
protected static final int GUESS
public static final int SSHDSS
public static final int SSHRSA
public static final int ECDSA256
public static final int ECDSA384
public static final int ECDSA521
protected String marker
protected String host
protected int type
protected byte[] key
protected String comment
public HostKey(String host, byte[] key) throws JSchException
host
- the host name (or names, as a comma-separated list)key
- the key data.JSchException
public HostKey(String host, int type, byte[] key) throws JSchException
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.JSchException
public HostKey(String host, int type, byte[] key, String comment) throws JSchException
JSchException
public HostKey(String marker, String host, int type, byte[] key, String comment) throws JSchException
JSchException
public String getHost()
public String getType()
protected static int name2type(String name)
public String getKey()
public String getFingerPrint(JSch jsch)
public String getComment()
public String getMarker()
This is a simplified version of the inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.