## Uses of Class
net.i2p.data.i2np.GarlicMessage

- Packages that use GarlicMessage
  Package | Description
  --- | ---
  net.i2p.router.message | Garlic message creation, parsing, and source routing for I2P communications.
  net.i2p.router.networkdb.kademlia | Kademlia DHT implementation and floodfill router functionality for I2P.

- - ### Uses of GarlicMessage in net.i2p.router.message

    Methods in net.i2p.router.message that return GarlicMessage
    Modifier and Type | Method and Description
    --- | ---
    `static GarlicMessage` | GarlicMessageBuilder.`buildECIESMessage(RouterContext ctx, GarlicConfig config)` Encrypt from an anonymous source.
    `(package private) static GarlicMessage` | GarlicMessageBuilder.`buildECIESMessage(RouterContext ctx, GarlicConfig config, Hash from, Destination to, SessionKeyManager skm, ReplyCallback callback)` ECIES_X25519 and PQ only.
    `static GarlicMessage` | GarlicMessageBuilder.`buildMessage(RouterContext ctx, GarlicConfig config, SessionKey encryptKey, RatchetSessionTag encryptTag)` Ratchet only.
    `static GarlicMessage` | GarlicMessageBuilder.`buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags, int numTagsToDeliver, int lowTagsThreshold, SessionKeyManager skm)` ELGAMAL_2048 only.
    `static GarlicMessage` | GarlicMessageBuilder.`buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags, int numTagsToDeliver, SessionKeyManager skm)` ELGAMAL_2048 only Called by OCMJH
    `static GarlicMessage` | GarlicMessageBuilder.`buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags, SessionKeyManager skm)` Now unused, since we have to generate a reply token first in OCMOSJ but we don't know if tags are required yet.
    `static GarlicMessage` | GarlicMessageBuilder.`buildMessage(RouterContext ctx, GarlicConfig config, Set<SessionTag> wrappedTags, PublicKey target, SessionKey encryptKey, SessionTag encryptTag)` ELGAMAL_2048 only.
    `(package private) static GarlicMessage` | OutboundClientMessageJobHelper.`createGarlicMessage(RouterContext ctx, long replyToken, long expiration, PublicKey recipientPK, PayloadGarlicConfig dataClove, Hash from, Destination dest, TunnelInfo replyTunnel, int tagsToSendOverride, int lowTagsOverride, SessionKey wrappedKey, Set<SessionTag> wrappedTags, boolean requireAck, LeaseSet bundledReplyLeaseSet, ReplyCallback callback)` Allow the app to specify the data clove directly, which enables OutboundClientMessage to resend the same payload (including expiration and unique id) in different garlics (down different tunnels) This is called from OCMOSJ

    Methods in net.i2p.router.message with parameters of type GarlicMessage
    Modifier and Type | Method and Description
    --- | ---
    `(package private) CloveSet` | GarlicMessageParser.`getGarlicCloves(GarlicMessage message, PrivateKey elgKey, PrivateKey ecKey, SessionKeyManager skm)` Supports both ELGAMAL_2048 and ECIES_X25519.
    `(package private) CloveSet` | GarlicMessageParser.`getGarlicCloves(GarlicMessage message, PrivateKey encryptionKey, SessionKeyManager skm)` Supports ELGAMAL_2048, ECIES_X25519, and PQ
    `void` | GarlicMessageReceiver.`receive(GarlicMessage message)` Processes a received GarlicMessage by attempting to decrypt it with the appropriate keys.

    Constructors in net.i2p.router.message with parameters of type GarlicMessage
    Constructor and Description
    `HandleGarlicMessageJob(RouterContext context, GarlicMessage msg, RouterIdentity from, Hash fromHash, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel)` Constructs a job to handle an inbound garlic message.

  - ### Uses of GarlicMessage in net.i2p.router.networkdb.kademlia

    Methods in net.i2p.router.networkdb.kademlia that return GarlicMessage
    Modifier and Type | Method and Description
    --- | ---
    `(package private) GarlicMessage` | MessageWrapper.WrappedMessage.`getMessage()`
    `static GarlicMessage` | MessageWrapper.`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` | MessageWrapper.`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` | MessageWrapper.`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` | MessageWrapper.`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.

    Constructors in net.i2p.router.networkdb.kademlia with parameters of type GarlicMessage
    Constructor and Description
    `WrappedMessage(GarlicMessage msg, SessionKeyManager skm, PublicKey sentTo, SessionKey sentKey, TagSetHandle tsh)`