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,
PrivateKey elgKey,
PrivateKey ecKey,
MuxedSKM keyManager)
Try to decrypt the message with one or both of the given private keys
|
CloveSet |
decrypt(byte[] 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,
PrivateKey targetPrivateKey,
RatchetSKM keyManager)
NSR/ES only.
|
(package private) CloveSet |
decryptSlow(byte[] data,
PrivateKey targetPrivateKey,
RatchetSKM keyManager)
NS only.
|
(package private) static PrivateKey |
doDH(PrivateKey privkey,
PublicKey pubkey) |
byte[] |
encrypt(CloveSet cloves,
PublicKey target)
Encrypt the data to the target using the given key from an anonymous source,
for netdb lookups.
|
byte[] |
encrypt(CloveSet cloves,
PublicKey target,
Destination to,
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,
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, PrivateKey elgKey, PrivateKey ecKey, MuxedSKM keyManager) throws DataFormatException
elgKey
- must be ElG, non-nullecKey
- must be EC, non-nullDataFormatException
public CloveSet decrypt(byte[] data, PrivateKey targetPrivateKey, RatchetSKM keyManager) throws DataFormatException
DataFormatException
CloveSet decryptFast(byte[] data, PrivateKey targetPrivateKey, RatchetSKM keyManager) throws DataFormatException
DataFormatException
CloveSet decryptSlow(byte[] data, PrivateKey targetPrivateKey, RatchetSKM keyManager) throws DataFormatException
DataFormatException
public byte[] encrypt(CloveSet cloves, PublicKey target, Destination to, 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, SessionKey key, RatchetSessionTag tag)
- 8 byte SessionTag - payload - 16 byte MAC
public byte[] encrypt(CloveSet cloves, PublicKey target)
target
- public key to which the data should be encrypted.static final PrivateKey doDH(PrivateKey privkey, PublicKey pubkey)