com.mindbright.ssh2
Class SSH2KEXDHGroupNumSHA1

java.lang.Object
  extended by com.mindbright.ssh2.SSH2KeyExchanger
      extended by com.mindbright.ssh2.SSH2KEXDHGroupNumSHA1
Direct Known Subclasses:
SSH2KEXDHGroup14SHA1, SSH2KEXDHGroup1SHA1

public abstract class SSH2KEXDHGroupNumSHA1
extends SSH2KeyExchanger

Base class for diffie hellman key exchange using predefined groups.


Field Summary
protected  java.math.BigInteger clientE
           
protected  DHPrivateKey dhPrivateKey
           
protected  DHPublicKey dhPublicKey
           
protected  byte[] exchangeHash_H
           
protected  java.math.BigInteger serverF
           
protected  byte[] serverHostKey
           
protected  KeyPair serverKey
           
protected  MessageDigest sha1
           
protected  byte[] sharedSecret_K
           
protected  SSH2Transport transport
           
 
Constructor Summary
SSH2KEXDHGroupNumSHA1()
           
 
Method Summary
protected  void computeExchangeHash_H()
           
protected  void computeSharedSecret_K(DHPublicKeySpec peerPubSpec)
           
protected  MessageDigest createHash()
           
protected  void generateDHKeyPair(DHParameterSpec dhParams)
           
 byte[] getExchangeHash_H()
           
 MessageDigest getExchangeHashAlgorithm()
           
abstract  java.math.BigInteger getGroupG()
           
abstract  java.math.BigInteger getGroupP()
           
 java.lang.String getHostKeyAlgorithms()
           
abstract  java.lang.String getName()
           
 byte[] getSharedSecret_K()
           
 void init(SSH2Transport transport)
           
 void init(SSH2Transport transport, KeyPair serverKey)
           
 void processKEXMethodPDU(SSH2TransportPDU pdu)
           
protected  void sendDHINIT(int type)
           
 
Methods inherited from class com.mindbright.ssh2.SSH2KeyExchanger
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transport

protected SSH2Transport transport

dhPublicKey

protected DHPublicKey dhPublicKey

dhPrivateKey

protected DHPrivateKey dhPrivateKey

serverHostKey

protected byte[] serverHostKey

serverF

protected java.math.BigInteger serverF

clientE

protected java.math.BigInteger clientE

sharedSecret_K

protected byte[] sharedSecret_K

exchangeHash_H

protected byte[] exchangeHash_H

sha1

protected MessageDigest sha1

serverKey

protected KeyPair serverKey
Constructor Detail

SSH2KEXDHGroupNumSHA1

public SSH2KEXDHGroupNumSHA1()
Method Detail

getGroupP

public abstract java.math.BigInteger getGroupP()

getGroupG

public abstract java.math.BigInteger getGroupG()

getName

public abstract java.lang.String getName()

init

public void init(SSH2Transport transport)
          throws SSH2Exception
Specified by:
init in class SSH2KeyExchanger
Throws:
SSH2Exception

init

public void init(SSH2Transport transport,
                 KeyPair serverKey)
          throws SSH2Exception
Throws:
SSH2Exception

processKEXMethodPDU

public void processKEXMethodPDU(SSH2TransportPDU pdu)
                         throws SSH2Exception
Specified by:
processKEXMethodPDU in class SSH2KeyExchanger
Throws:
SSH2Exception

getExchangeHashAlgorithm

public MessageDigest getExchangeHashAlgorithm()
Specified by:
getExchangeHashAlgorithm in class SSH2KeyExchanger

getSharedSecret_K

public byte[] getSharedSecret_K()
Specified by:
getSharedSecret_K in class SSH2KeyExchanger

getExchangeHash_H

public byte[] getExchangeHash_H()
Specified by:
getExchangeHash_H in class SSH2KeyExchanger

getHostKeyAlgorithms

public java.lang.String getHostKeyAlgorithms()
Specified by:
getHostKeyAlgorithms in class SSH2KeyExchanger

computeExchangeHash_H

protected void computeExchangeHash_H()

computeSharedSecret_K

protected void computeSharedSecret_K(DHPublicKeySpec peerPubSpec)
                              throws SSH2Exception
Throws:
SSH2Exception

sendDHINIT

protected void sendDHINIT(int type)
                   throws SSH2Exception
Throws:
SSH2Exception

createHash

protected MessageDigest createHash()
                            throws SSH2Exception
Throws:
SSH2Exception

generateDHKeyPair

protected void generateDHKeyPair(DHParameterSpec dhParams)
                          throws SSH2Exception
Throws:
SSH2Exception