public class DHAgreement extends Object
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.
Constructor and Description |
---|
DHAgreement() |
Modifier and Type | Method and Description |
---|---|
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.
|
BigInteger |
calculateMessage()
calculate our initial message.
|
void |
init(CipherParameters param) |
public void init(CipherParameters param)
public BigInteger calculateMessage()
public BigInteger calculateAgreement(DHPublicKeyParameters pub, BigInteger message)
Copyright © 2015. All rights reserved.