Package com.trilead.ssh2.crypto.dh

# Class DhExchange

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

public class DhExchange extends Object
DhExchange.

## Constructor Summary

Constructors
Constructor
Description
`DhExchange()`

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey)`
`BigInteger`
`getE()`
`BigInteger`
`getK()`
`void`
`init(int group, SecureRandom rnd)`
`void`
`setF(BigInteger f)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DhExchange

public DhExchange()

## Method Details

### init

public void init(int group, SecureRandom rnd)

### getE

public BigInteger getE()

Returns:
  Returns the e.
Throws:
  `IllegalStateException`

### getK

public BigInteger getK()

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

### setF

public void setF(BigInteger f)

Parameters:
  `f` -

### calculateH

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

Throws:
  `UnsupportedEncodingException`