public final class ECIESAEADEngine extends Object
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.
|
byte[] |
encrypt(CloveSet cloves,
PublicKey target,
PrivateKey priv,
RatchetSKM keyManager)
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.
|
void |
shutdown()
Cannot be restarted
|
void |
startup()
May be called multiple times
|
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
public byte[] encrypt(CloveSet cloves, PublicKey target, PrivateKey priv, RatchetSKM keyManager)
target
- public key to which the data should be encrypted.priv
- local private key to encrypt with, from the leaseset