org.bouncycastle.crypto.agreement
Class DHBasicAgreement

java.lang.Object
  extended by org.bouncycastle.crypto.agreement.DHBasicAgreement
All Implemented Interfaces:
BasicAgreement

public class DHBasicAgreement
extends java.lang.Object
implements BasicAgreement

a Diffie-Hellman key agreement class.

note: This is only the basic algorithm, it doesn't take advantage of long term public keys if they are available. See the DHAgreement class for a "better" implementation.


Field Summary
private  DHParameters dhParams
           
private  DHPrivateKeyParameters key
           
private  java.security.SecureRandom random
           
 
Constructor Summary
DHBasicAgreement()
           
 
Method Summary
 java.math.BigInteger calculateAgreement(CipherParameters pubKey)
          given a short term public key from a given party calculate the next message in the agreement sequence.
 void init(CipherParameters param)
          initialise the agreement engine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

private DHPrivateKeyParameters key

dhParams

private DHParameters dhParams

random

private java.security.SecureRandom random
Constructor Detail

DHBasicAgreement

public DHBasicAgreement()
Method Detail

init

public void init(CipherParameters param)
Description copied from interface: BasicAgreement
initialise the agreement engine.

Specified by:
init in interface BasicAgreement

calculateAgreement

public java.math.BigInteger calculateAgreement(CipherParameters pubKey)
given a short term public key from a given party calculate the next message in the agreement sequence.

Specified by:
calculateAgreement in interface BasicAgreement