public abstract class KeyExchange extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
DSS |
protected int |
ECDSA |
protected byte[] |
H |
protected byte[] |
K |
protected byte[] |
K_S |
protected int |
RSA |
protected Session |
session |
protected HASH |
sha |
static int |
STATE_END
constant used by
getState() when no more key exchange
packet is expected. |
Constructor and Description |
---|
KeyExchange() |
Modifier and Type | Method and Description |
---|---|
String |
getFingerPrint()
returns the finger print of the server's public key.
|
String |
getKeyAlgorithName() |
String |
getKeyType()
Returns the type of key used by the server.
|
abstract int |
getState()
returns the identifier of the next SSH packet expected,
or
STATE_END if the KeyExchange was already
successfully finished. |
protected static String[] |
guess(byte[] I_S,
byte[] I_C) |
abstract void |
init(Session session,
byte[] V_S,
byte[] V_C,
byte[] I_S,
byte[] I_C)
Initializes the key exchange object.
|
abstract boolean |
next(Buffer buf)
Does the next step in the key exchange algorithm.
|
protected byte[] |
normalize(byte[] secret) |
protected boolean |
verify(String alg,
byte[] K_S,
int index,
byte[] sig_of_H) |
public static final int STATE_END
getState()
when no more key exchange
packet is expected.protected Session session
protected HASH sha
protected byte[] K
protected byte[] H
protected byte[] K_S
protected final int RSA
protected final int DSS
protected final int ECDSA
public abstract void init(Session session, byte[] V_S, byte[] V_C, byte[] I_S, byte[] I_C) throws Exception
session
- the session object.V_S
- the server's identification string sent before negotiationV_C
- the client's identification string sent before negotiationI_S
- the server's complete SSH_MSG_KEXINIT message.I_C
- the server's complete SSH_MSG_KEXINIT message.Exception
public abstract boolean next(Buffer buf) throws Exception
buf
- the received packet. It will have the same
message-type as getState()
returned before.Exception
public abstract int getState()
STATE_END
if the KeyExchange was already
successfully finished.public String getKeyType()
"DSA"
,
"RSA"
or "ECDSA"
.public String getKeyAlgorithName()
protected static String[] guess(byte[] I_S, byte[] I_C)
public String getFingerPrint()
HASH
implementation given by
session.getConfig("md5")
.protected byte[] normalize(byte[] secret)
This is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.