public class DHSessionKeyBuilder extends Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
DHSessionKeyBuilder.Factory |
|
static class |
DHSessionKeyBuilder.InvalidPublicParameterException |
|
static class |
DHSessionKeyBuilder.PrecalcRunner |
Try to keep DH pairs at the ready.
|
Constructor | Description |
---|---|
DHSessionKeyBuilder() |
Create a new public/private value pair for the DH exchange.
|
DHSessionKeyBuilder(I2PAppContext ctx) |
Create a new public/private value pair for the DH exchange.
|
Modifier and Type | Method | Description |
---|---|---|
ByteArray |
getExtraBytes() |
Retrieve the extra bytes beyond the session key resulting from the DH exchange.
|
BigInteger |
getMyPublicValue() |
Retrieve the public value used by the local participant in the DH exchange,
|
byte[] |
getMyPublicValueBytes() |
Return a 256 byte representation of our public key, with leading 0s
if necessary.
|
BigInteger |
getPeerPublicValue() |
|
byte[] |
getPeerPublicValueBytes() |
Return a 256 byte representation of his public key, with leading 0s
if necessary.
|
SessionKey |
getSessionKey() |
Retrieve the session key, calculating it if necessary (and if possible).
|
void |
setPeerPublicValue(byte[] val) |
|
void |
setPeerPublicValue(BigInteger peerVal) |
Specify the value given by the peer for use in the session key negotiation
|
DHSessionKeyBuilder()
DHSessionKeyBuilder(I2PAppContext ctx)
public BigInteger getMyPublicValue()
public byte[] getMyPublicValueBytes()
public void setPeerPublicValue(BigInteger peerVal) throws DHSessionKeyBuilder.InvalidPublicParameterException
IllegalStateException
- if already setDHSessionKeyBuilder.InvalidPublicParameterException
public void setPeerPublicValue(byte[] val) throws DHSessionKeyBuilder.InvalidPublicParameterException
val
- 256 bytesDHSessionKeyBuilder.InvalidPublicParameterException
public BigInteger getPeerPublicValue()
public byte[] getPeerPublicValueBytes()
public SessionKey getSessionKey()
public ByteArray getExtraBytes()