TorKeyAgreement
class implements the diffie-hellman key agreement protocol using the parameters specified in the main Tor specification (tor-spec.txt). An instance of this class can only be used to perform a single key agreement operation. After instantiating the class, a user calls {@link #getPublicValue()} or {@link #getPublicKeyBytes()}to retrieve the public value to transmit to the peer in the key agreement operation. After receiving a public value from the peer, this value should be converted into a BigInteger
and {@link #isValidPublicValue(BigInteger)} should be called to verify that the peer has sent a safeand legal public value. If {@link #isValidPublicValue(BigInteger)} returns true, the peer publicvalue is valid and {@link #getSharedSecret(BigInteger)} can be called to complete the key agreementprotocol and return the shared secret value.
|
|
|
|