public class MessageWrapper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class | MessageWrapper.OneTimeSessionA single key and tag, for receiving a single message. |
(package private) static class | MessageWrapper.WrappedMessageWrapper so that we can keep track of the key and tags for later notification to the SKM |
| Modifier and Type | Method and Description |
|---|---|
static MessageWrapper.OneTimeSession | generateSession(RouterContext ctx,
Hash localDest,
long expiration,
boolean forceElG)Create a single key and tag, for receiving a single encrypted message,
and register it with the client's session key manager, to expire in the time specified. |
static MessageWrapper.OneTimeSession | generateSession(RouterContext ctx,
long expiration)Create a single key and tag, for receiving a single encrypted message,
and register it with our router's session key manager, to expire in the time specified. |
static MessageWrapper.OneTimeSession | generateSession(RouterContext ctx,
SessionKeyManager skm,
long expiration,
boolean forceElG)Create a single key and tag, for receiving a single encrypted message,
and register it with the client's session key manager, to expire in the time specified. |
(package private) static MessageWrapper.WrappedMessage | wrap(RouterContext ctx,
I2NPMessage m,
Hash from,
RouterInfo to)Garlic wrap a message from a client or this router, destined for a router,
to hide the contents from the OBEP. |
static GarlicMessage | wrap(RouterContext ctx,
I2NPMessage m,
MessageWrapper.OneTimeSession session)Garlic wrap a message from nobody, destined for an unknown router,
to hide the contents from the IBGW. |
static GarlicMessage | wrap(RouterContext ctx,
I2NPMessage m,
RouterInfo to)Garlic wrap a message from nobody, destined for a router,
to hide the contents from the OBEP. |
static GarlicMessage | wrap(RouterContext ctx,
I2NPMessage m,
SessionKey encryptKey,
RatchetSessionTag encryptTag)Garlic wrap a message from nobody, destined for an unknown router,
to hide the contents from the IBGW. |
static GarlicMessage | wrap(RouterContext ctx,
I2NPMessage m,
SessionKey encryptKey,
SessionTag encryptTag)Garlic wrap a message from nobody, destined for an unknown router,
to hide the contents from the IBGW. |
public static MessageWrapper.OneTimeSession generateSession(RouterContext ctx, Hash localDest, long expiration, boolean forceElG)
ctx - the router contextlocalDest - the local client destinationexpiration - time from nowforceElG - if true, force ElGamal even if ratchet is availablepublic static MessageWrapper.OneTimeSession generateSession(RouterContext ctx, long expiration)
ctx - the router contextexpiration - time from nowpublic static MessageWrapper.OneTimeSession generateSession(RouterContext ctx, SessionKeyManager skm, long expiration, boolean forceElG)
ctx - the router contextskm - the session key managerexpiration - time from nowforceElG - if true, force ElGamal even if ratchet is availablestatic MessageWrapper.WrappedMessage wrap(RouterContext ctx, I2NPMessage m, Hash from, RouterInfo to)
from - must be a local client with a session key manager,
or null to use the router's session key manager.
SessionKeyManager MUST support ElGamal.to - must be ELGAMAL_2048 EncTypepublic static GarlicMessage wrap(RouterContext ctx, I2NPMessage m, MessageWrapper.OneTimeSession session)
ctx - the router contextm - the message to wrapsession - non-nullpublic static GarlicMessage wrap(RouterContext ctx, I2NPMessage m, RouterInfo to)
ctx - the router contextm - the message to wrapto - must be ELGAMAL_2048 or ECIES_X25519 EncTypepublic static GarlicMessage wrap(RouterContext ctx, I2NPMessage m, SessionKey encryptKey, RatchetSessionTag encryptTag)
ctx - the router contextm - the message to wrapencryptKey - non-nullencryptTag - non-nullpublic static GarlicMessage wrap(RouterContext ctx, I2NPMessage m, SessionKey encryptKey, SessionTag encryptTag)
ctx - the router contextm - the message to wrapencryptKey - non-nullencryptTag - non-null