com.maverick.ssh2
Class SshKeyExchange

java.lang.Object
  extended bycom.maverick.ssh2.SshKeyExchange
Direct Known Subclasses:
DiffieHellmanGroup14Sha1, DiffieHellmanGroup1Sha1, DiffieHellmanGroupExchangeSha1

public abstract class SshKeyExchange
extends java.lang.Object

Abstract representation of an SSH key exchange.

Author:
Lee David Painter

Field Summary
protected  byte[] exchangeHash
          The exchange hash produced during key exchange.
protected  byte[] hostKey
          The server's host key.
protected  java.math.BigInteger secret
          The secret value produced during key exchange.
protected  byte[] signature
          The signature generated over the exchange hash
protected  TransportProtocol transport
          The transport protocol for sending/receiving messages
 
Constructor Summary
SshKeyExchange()
          Contruct an uninitialized key exchange
 
Method Summary
abstract  java.lang.String getAlgorithm()
          Get the key exchange algorithm name.
 byte[] getExchangeHash()
          Get the output of the key exchange
 byte[] getHostKey()
          Get the host key supplied during key exchange.
 java.math.BigInteger getSecret()
          Get the secret value produced during key exchange.
 byte[] getSignature()
          Get the signature produced during key exchange.
 void init(TransportProtocol transport)
          Initialize the key exchange.
abstract  boolean isKeyExchangeMessage(int messageid)
           
abstract  void performClientExchange(java.lang.String clientId, java.lang.String serverId, byte[] clientKexInit, byte[] serverKexInit)
          Overide to perform the client side key exchange.
 void reset()
          Reset the key exchange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

secret

protected java.math.BigInteger secret
The secret value produced during key exchange.


exchangeHash

protected byte[] exchangeHash
The exchange hash produced during key exchange.


hostKey

protected byte[] hostKey
The server's host key.


signature

protected byte[] signature
The signature generated over the exchange hash


transport

protected TransportProtocol transport
The transport protocol for sending/receiving messages

Constructor Detail

SshKeyExchange

public SshKeyExchange()
Contruct an uninitialized key exchange

Method Detail

getAlgorithm

public abstract java.lang.String getAlgorithm()
Get the key exchange algorithm name.

Returns:
the key exchange algorithm.

getExchangeHash

public byte[] getExchangeHash()
Get the output of the key exchange

Returns:
the exchange hash output.

getHostKey

public byte[] getHostKey()
Get the host key supplied during key exchange.

Returns:
the server's host key

getSecret

public java.math.BigInteger getSecret()
Get the secret value produced during key exchange.

Returns:
The secret value producted during key exchange

getSignature

public byte[] getSignature()
Get the signature produced during key exchange.

Returns:
the signature produced from the exchange hash.

init

public void init(TransportProtocol transport)
          throws SshException
Initialize the key exchange.

Parameters:
transport -
Throws:
java.io.IOException
SshException

performClientExchange

public abstract void performClientExchange(java.lang.String clientId,
                                           java.lang.String serverId,
                                           byte[] clientKexInit,
                                           byte[] serverKexInit)
                                    throws SshException
Overide to perform the client side key exchange. The implementation should not return until all messages have been sent.

Parameters:
clientId -
serverId -
clientKexInit -
serverKexInit -
Throws:
java.io.IOException
SshException

isKeyExchangeMessage

public abstract boolean isKeyExchangeMessage(int messageid)

reset

public void reset()
Reset the key exchange.



Copyright © 2003 3SP LTD. All Rights Reserved.