## com.trilead.ssh2.crypto.dh
Class DhExchange

    java.lang.Object
      com.trilead.ssh2.crypto.dh.DhExchange

    public class DhExchange

extends java.lang.Object

DhExchange.

Constructor Summary
`DhExchange()`

Method Summary
`byte[]` `calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey)`
`java.math.BigInteger` `getE()`
`java.math.BigInteger` `getK()`
`void` `init(int group, java.security.SecureRandom rnd)`
`void` `setF(java.math.BigInteger f)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DhExchange

    public DhExchange()

Method Detail

### init

    public void init(int group,
                     java.security.SecureRandom rnd)

### getE

    public java.math.BigInteger getE()

  Returns:
    Returns the e.
  Throws:
    `java.lang.IllegalStateException`

### getK

    public java.math.BigInteger getK()

  Returns:
    Returns the shared secret k.
  Throws:
    `java.lang.IllegalStateException`

### setF

    public void setF(java.math.BigInteger f)

  Parameters:
    `f` -

### calculateH

    public byte[] calculateH(byte[] clientversion,
                             byte[] serverversion,
                             byte[] clientKexPayload,
                             byte[] serverKexPayload,
                             byte[] hostKey)
                      throws java.io.UnsupportedEncodingException

  Throws:
    `java.io.UnsupportedEncodingException`