public class MessageWrapper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MessageWrapper.OneTimeSession
A single key and tag, for receiving a single message.
|
(package private) static class |
MessageWrapper.WrappedMessage
Wrapper so that we can keep track of the key and tags
for later notification to the SKM
|
Constructor and Description |
---|
MessageWrapper() |
Modifier and Type | Method and Description |
---|---|
static MessageWrapper.OneTimeSession |
generateSession(RouterContext ctx)
Create a single key and tag, for receiving a single encrypted message,
and register it with the router's session key manager, to expire in two minutes.
|
static MessageWrapper.OneTimeSession |
generateSession(RouterContext ctx,
Hash localDest)
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 two minutes.
|
static MessageWrapper.OneTimeSession |
generateSession(RouterContext ctx,
SessionKeyManager skm)
Create a single key and tag, for receiving a single encrypted message,
and register it with the given session key manager, to expire in two minutes.
|
(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.
|
(package private) 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,
SessionTag encryptTag)
Garlic wrap a message from nobody, destined for an unknown router,
to hide the contents from the IBGW.
|
static 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 managerstatic GarlicMessage wrap(RouterContext ctx, I2NPMessage m, RouterInfo to)
public static MessageWrapper.OneTimeSession generateSession(RouterContext ctx)
public static MessageWrapper.OneTimeSession generateSession(RouterContext ctx, Hash localDest)
public static MessageWrapper.OneTimeSession generateSession(RouterContext ctx, SessionKeyManager skm)
public static GarlicMessage wrap(RouterContext ctx, I2NPMessage m, MessageWrapper.OneTimeSession session)
session
- non-nullpublic static GarlicMessage wrap(RouterContext ctx, I2NPMessage m, SessionKey encryptKey, SessionTag encryptTag)
encryptKey
- non-nullencryptTag
- non-null