Class GarlicMessageParser

java.lang.Object
net.i2p.router.message.GarlicMessageParser

public class GarlicMessageParser extends Object
Read a GarlicMessage, decrypt it, and return the resulting CloveSet. Thread-safe, does not contain any state. Public as it's now in the RouterContext.
  • Constructor Details

    • GarlicMessageParser

      public GarlicMessageParser(RouterContext context)
  • Method Details

    • getGarlicCloves

      CloveSet getGarlicCloves(GarlicMessage message, PrivateKey encryptionKey, SessionKeyManager skm)
      Supports both ELGAMAL_2048 and ECIES_X25519.
      Parameters:
      encryptionKey - either type
      skm - use tags from this session key manager
      Returns:
      null on error
    • getGarlicCloves

      CloveSet getGarlicCloves(GarlicMessage message, PrivateKey elgKey, PrivateKey ecKey, SessionKeyManager skm)
      Supports both ELGAMAL_2048 and ECIES_X25519.
      Parameters:
      elgKey - must be ElG, non-null
      ecKey - must be EC, non-null
      skm - use tags from this session key manager
      Returns:
      null on error
      Since:
      0.9.44
    • readCloveSet

      public CloveSet readCloveSet(byte[] data, int offset) throws DataFormatException
      ElGamal only
      Parameters:
      offset - where in data to start
      Returns:
      non-null, throws on all errors
      Throws:
      DataFormatException
      Since:
      public since 0.9.44