com.maverick.ssh.components.jce
Class DiffieHellmanGroup14Sha1

java.lang.Object
  extended bycom.maverick.ssh.components.SshKeyExchangeClient
      extended bycom.maverick.ssh.components.jce.DiffieHellmanGroup14Sha1
All Implemented Interfaces:
SshKeyExchange

public class DiffieHellmanGroup14Sha1
extends SshKeyExchangeClient

An implementation of the diffie-hellman-group1-sha1 key exchange mechanism that uses JCE provider for DH agreement and Digest.

Author:
Lee David Painter

Field Summary
static java.lang.String DIFFIE_HELLMAN_GROUP14_SHA1
          Constant for the algorithm name "diffie-hellman-group1-sha1".
 
Fields inherited from class com.maverick.ssh.components.SshKeyExchangeClient
exchangeHash, hostKey, secret, signature, transport
 
Constructor Summary
DiffieHellmanGroup14Sha1()
           
 
Method Summary
protected  void calculateExchangeHash()
          Calculates the exchange hash as an SHA1 hash of the following data.
 java.lang.String getAlgorithm()
          Get the key exchange algorithm name.
 boolean isKeyExchangeMessage(int messageid)
           
 void performClientExchange(java.lang.String clientIdentification, java.lang.String serverIdentification, byte[] clientKexInit, byte[] serverKexInit)
          Override to perform the client side key exchange.
 
Methods inherited from class com.maverick.ssh.components.SshKeyExchangeClient
getExchangeHash, getHostKey, getSecret, getSignature, init, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIFFIE_HELLMAN_GROUP14_SHA1

public static final java.lang.String DIFFIE_HELLMAN_GROUP14_SHA1
Constant for the algorithm name "diffie-hellman-group1-sha1".

See Also:
Constant Field Values
Constructor Detail

DiffieHellmanGroup14Sha1

public DiffieHellmanGroup14Sha1()
Method Detail

performClientExchange

public void performClientExchange(java.lang.String clientIdentification,
                                  java.lang.String serverIdentification,
                                  byte[] clientKexInit,
                                  byte[] serverKexInit)
                           throws SshException
Description copied from class: SshKeyExchangeClient
Override to perform the client side key exchange. The implementation should not return until all messages have been sent.

Specified by:
performClientExchange in class SshKeyExchangeClient
Parameters:
clientIdentification -
serverIdentification -
clientKexInit -
serverKexInit -
Throws:
SshException

calculateExchangeHash

protected void calculateExchangeHash()
                              throws SshException

Calculates the exchange hash as an SHA1 hash of the following data.

  String         the client's version string (CR and NL excluded)
  String         the server's version string (CR and NL excluded)
  String         the payload of the client's SSH_MSG_KEXINIT
  String         the payload of the server's SSH_MSG_KEXINIT
  String         the host key
  BigInteger     e, exchange value sent by the client
  BigInteger     f, exchange value sent by the server
  BigInteger     K, the shared secret
 

Throws:
java.io.IOException
SshException

getAlgorithm

public java.lang.String getAlgorithm()
Description copied from class: SshKeyExchangeClient
Get the key exchange algorithm name.

Specified by:
getAlgorithm in class SshKeyExchangeClient
Returns:
the key exchange algorithm.

isKeyExchangeMessage

public boolean isKeyExchangeMessage(int messageid)
Specified by:
isKeyExchangeMessage in class SshKeyExchangeClient


Copyright © 2003 3SP LTD. All Rights Reserved.