net.i2p.router.networkdb.kademlia

## Class MessageWrapper

- java.lang.Object
- - net.i2p.router.networkdb.kademlia.MessageWrapper

-      class MessageWrapper
      extends Object

  Method and class for garlic encrypting outbound netdb traffic, including management of the ElGamal/AES tags
  Since:
    0.7.10

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(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 Summary

    Constructors
    Constructor and Description
    `MessageWrapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `(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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MessageWrapper

          MessageWrapper()

  - ### Method Detail

    - #### wrap

          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. Caller must call acked() or fail() on the returned object.
      Parameters:
        `from` - must be a local client with a session key manager, or null to use the router's session key manager
      Returns:
        null on encrypt failure