Save This Page
Home » crypto-143 » org.bouncycastle.crypto.agreement » [javadoc | source]
org.bouncycastle.crypto.agreement
public class: DHAgreement [javadoc | source]
java.lang.Object
   org.bouncycastle.crypto.agreement.DHAgreement
a Diffie-Hellman key exchange engine.

note: This uses MTI/A0 key agreement in order to make the key agreement secure against passive attacks. If you're doing Diffie-Hellman and both parties have long term public keys you should look at using this. For further information have a look at RFC 2631.

It's possible to extend this to more than two parties as well, for the moment that is left as an exercise for the reader.
Method from org.bouncycastle.crypto.agreement.DHAgreement Summary:
calculateAgreement,   calculateMessage,   init
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.bouncycastle.crypto.agreement.DHAgreement Detail:
 public BigInteger calculateAgreement(DHPublicKeyParameters pub,
    BigInteger message) 
    given a message from a given party and the corresponding public key, calculate the next message in the agreement sequence. In this case this will represent the shared secret.
 public BigInteger calculateMessage() 
    calculate our initial message.
 public  void init(CipherParameters param)