|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sshtools.j2ssh.transport.kex.SshKeyExchange
This class provides a framework for implementing SSH protocol key exchange methods for the API.
| Field Summary | |
protected SshMessageStore |
messageStore
The methods message store |
| Constructor Summary | |
SshKeyExchange()
Constructor for the KeyExchange object |
|
| Method Summary | |
KeyExchangeState |
getState()
Gets the state of the key exchange |
abstract void |
init(TransportProtocol transport,
java.lang.String clientId,
java.lang.String serverId,
byte[] clientKexInit,
byte[] serverKexInit)
Initiates the key exchange object before starting |
protected abstract void |
onMessageReceived(SshMessage msg)
Called by the framwork when a registered message is recieved. |
void |
run()
Main processing method for the KeyExchange object |
protected void |
setComplete(byte[] exchangeHash,
byte[] hostKey,
byte[] signature,
java.math.BigInteger secret)
Sets the key exchanges state to complete |
protected void |
setFailed(java.lang.String reason)
Sets the key exchanges state to failed |
abstract void |
startClient()
Starts the client side of the key exchange |
abstract void |
startServer()
Starts the server side of the key exchange |
void |
stop()
Stops the key exchange |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SshMessageStore messageStore
| Constructor Detail |
public SshKeyExchange()
| Method Detail |
protected void setComplete(byte[] exchangeHash,
byte[] hostKey,
byte[] signature,
java.math.BigInteger secret)
exchangeHash - The output of the key exchangehostKey - The servers host keysignature - The signaturesecret - The secret value output of the key exchangeprotected void setFailed(java.lang.String reason)
reason - The new failed valuepublic KeyExchangeState getState()
public void run()
run in interface java.lang.Runnablepublic void stop()
public abstract void init(TransportProtocol transport,
java.lang.String clientId,
java.lang.String serverId,
byte[] clientKexInit,
byte[] serverKexInit)
transport - The transport protocol for sending/receivingclientId - The clients identification stringserverId - The servers identification stringclientKexInit - The clients SSH_MSG_KEX_INIT payloadserverKexInit - The servers SSH_MSG_KEX_INIT payload
public abstract void startClient()
throws KeyExchangeException
KeyExchangeException - Throw if a key exchange error occures
public abstract void startServer()
throws KeyExchangeException
KeyExchangeException - Throw if a key exchange error occurs
protected abstract void onMessageReceived(SshMessage msg)
throws KeyExchangeException
msg - The message received
KeyExchangeException - Description of the Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||