public final class ECIESAEADEngine extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static long |
MAX_NS_AGE |
| Constructor and Description |
|---|
ECIESAEADEngine(RouterContext ctx)
Caller MUST call startup() to get threaded generation.
|
| Modifier and Type | Method and Description |
|---|---|
CloveSet |
decrypt(byte[] data,
net.i2p.data.PrivateKey elgKey,
net.i2p.data.PrivateKey ecKey,
MuxedSKM keyManager)
Try to decrypt the message with one or both of the given private keys
|
CloveSet |
decrypt(byte[] data,
net.i2p.data.PrivateKey targetPrivateKey,
RatchetSKM keyManager)
Decrypt the message using the given private key
and using tags from the specified key manager.
|
(package private) CloveSet |
decryptFast(byte[] data,
net.i2p.data.PrivateKey targetPrivateKey,
RatchetSKM keyManager)
NSR/ES only.
|
(package private) CloveSet |
decryptSlow(byte[] data,
net.i2p.data.PrivateKey targetPrivateKey,
RatchetSKM keyManager)
NS only.
|
(package private) static net.i2p.data.PrivateKey |
doDH(net.i2p.data.PrivateKey privkey,
net.i2p.data.PublicKey pubkey) |
byte[] |
encrypt(CloveSet cloves,
net.i2p.data.PublicKey target)
Encrypt the data to the target using the given key from an anonymous source,
for netdb lookups.
|
byte[] |
encrypt(CloveSet cloves,
net.i2p.data.PublicKey target,
net.i2p.data.Destination to,
net.i2p.data.PrivateKey priv,
RatchetSKM keyManager,
ReplyCallback callback)
Encrypt the data to the target using the given key and deliver the specified tags
No new session key
This is the one called from GarlicMessageBuilder and is the primary entry point.
|
byte[] |
encrypt(CloveSet cloves,
net.i2p.data.SessionKey key,
RatchetSessionTag tag)
Create an Existing Session Message to an anonymous target
using the given session key and tag, for netdb DSM/DSRM replies.
|
void |
shutdown()
Cannot be restarted
|
void |
startup()
May be called multiple times
|
static final long MAX_NS_AGE
public ECIESAEADEngine(RouterContext ctx)
public void startup()
public void shutdown()
public CloveSet decrypt(byte[] data, net.i2p.data.PrivateKey elgKey, net.i2p.data.PrivateKey ecKey, MuxedSKM keyManager) throws net.i2p.data.DataFormatException
elgKey - must be ElG, non-nullecKey - must be EC, non-nullnet.i2p.data.DataFormatExceptionpublic CloveSet decrypt(byte[] data, net.i2p.data.PrivateKey targetPrivateKey, RatchetSKM keyManager) throws net.i2p.data.DataFormatException
net.i2p.data.DataFormatExceptionCloveSet decryptFast(byte[] data, net.i2p.data.PrivateKey targetPrivateKey, RatchetSKM keyManager) throws net.i2p.data.DataFormatException
net.i2p.data.DataFormatExceptionCloveSet decryptSlow(byte[] data, net.i2p.data.PrivateKey targetPrivateKey, RatchetSKM keyManager) throws net.i2p.data.DataFormatException
net.i2p.data.DataFormatExceptionpublic byte[] encrypt(CloveSet cloves, net.i2p.data.PublicKey target, net.i2p.data.Destination to, net.i2p.data.PrivateKey priv, RatchetSKM keyManager, ReplyCallback callback)
target - public key to which the data should be encrypted.to - ignored if priv is nullpriv - local private key to encrypt with, from the leaseset
may be null for anonymous (N-in-IK)keyManager - ignored if priv is nullcallback - may be null, if non-null an ack will be requested (except NS/NSR),
ignored if priv is nullpublic byte[] encrypt(CloveSet cloves, net.i2p.data.SessionKey key, RatchetSessionTag tag)
- 8 byte SessionTag - payload - 16 byte MAC
public byte[] encrypt(CloveSet cloves, net.i2p.data.PublicKey target)
target - public key to which the data should be encrypted.static final net.i2p.data.PrivateKey doDH(net.i2p.data.PrivateKey privkey,
net.i2p.data.PublicKey pubkey)