com.jcraft.jsch.HostKey Class Reference

The public key of a SSH server. More...

Inheritance diagram for com.jcraft.jsch.HostKey:
Inheritance graph
[legend]

List of all members.

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")

Detailed Description

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.

See also:
HostKeyRepository

Definition at line 39 of file HostKey.java.


Constructor & Destructor Documentation

com.jcraft.jsch.HostKey.HostKey ( String  host,
byte[]  key 
) throws JSchException

creates a host key by guessing it's type from the data.

Parameters:
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.

Parameters:
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.


Member Function Documentation

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 (  ) 
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]

Member Data Documentation

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]
byte [] com.jcraft.jsch.HostKey.key [protected]
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().

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.


The documentation for this class was generated from the following file:

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1