java.lang.Object
net.i2p.client.impl.HandlerImpl
net.i2p.client.impl.MessagePayloadMessageHandler
All Implemented Interfaces:
I2CPMessageHandler

class MessagePayloadMessageHandlerextends HandlerImpl
Handle I2CP MessagePayloadMessages from the router delivering the contents of a message by accepting it, decrypting the payload, adding it to the set of received messages, and telling the router that it has been received correctly.

We don't really decrypt (no more end-to-end crypto).

  • Constructor Details

    • MessagePayloadMessageHandler

      public MessagePayloadMessageHandler(I2PAppContext context)
      Create the handler for I2CP message payload messages.
      Parameters:
      context - the application context, whose log manager supplies the handler logger
  • Method Details

    • handleMessage

      public void handleMessage(I2CPMessage message, I2PSessionImpl session)
      Handle an incoming I2CP message.
      Parameters:
      message - the incoming I2CP message, expected to be a MessagePayloadMessage
      session - the session the payload belongs to, which collects the message
    • decryptPayload

      private Payload decryptPayload(MessagePayloadMessage msg, I2PSessionImpl session)
      Decrypt the payload

      We don't really decrypt (no more end-to-end crypto) If we do, we need to use the correct key manager in the decrypt() call below.

      Parameters:
      msg - the message carrying the payload
      session - unused, kept for the end-to-end crypto that was removed
      Returns:
      the payload with its encrypted data copied to the unencrypted data