public class Datagram2 extends Object
+----+----+----+----+----+----+----+----+ | | ~ from ~ ~ ~ | | +----+----+----+----+----+----+----+----+ | flags | options (optional) | +----+----+ + ~ ~ ~ ~ +----+----+----+----+----+----+----+----+ | | ~ offline_signature (optional) ~ ~ expires, sigtype, pubkey, offsig ~ | | +----+----+----+----+----+----+----+----+ | | ~ payload ~ ~ ~ | | +----+----+----+----+----+----+----+----+ | | ~ signature ~ ~ ~ | | +----+----+----+----+----+----+----+----+
| Modifier and Type | Method and Description |
|---|---|
Properties | getOptions()Get the options of an I2P repliable datagram (previously loaded with the
load() method), if any |
byte[] | getPayload()Get the payload carried by an I2P repliable datagram (previously loaded
with the load() method) |
Destination | getSender()Get the sender of an I2P repliable datagram (previously loaded with the
load() method) |
static Datagram2 | load(I2PAppContext ctx,
I2PSession session,
byte[] dgram)Load an I2P repliable datagram and verify the signature. |
static byte[] | make(I2PAppContext ctx,
I2PSession session,
byte[] payload,
Hash tohash)Make a repliable I2P datagram2 containing the specified payload. |
static byte[] | make(I2PAppContext ctx,
I2PSession session,
byte[] payload,
Hash tohash,
Properties options)Make a repliable I2P datagram2 containing the specified payload. |
public Properties getOptions()
public byte[] getPayload()
public Destination getSender()
public static Datagram2 load(I2PAppContext ctx, I2PSession session, byte[] dgram) throws DataFormatException, I2PInvalidDatagramException
ctx - the I2P app contextsession - the I2P sessiondgram - non-null I2P repliable datagram to be loadedDataFormatException - If there is an error in the datagram formatI2PInvalidDatagramException - If the signature failspublic static byte[] make(I2PAppContext ctx, I2PSession session, byte[] payload, Hash tohash) throws DataFormatException
ctx - the I2P app contextsession - the I2P sessionpayload - non-null Bytes to be contained in the I2P datagram.tohash - the destination hashDataFormatException - if payload is too bigpublic static byte[] make(I2PAppContext ctx, I2PSession session, byte[] payload, Hash tohash, Properties options) throws DataFormatException
ctx - the I2P app contextsession - the I2P sessionpayload - non-null Bytes to be contained in the I2P datagram.tohash - the destination hashoptions - may be nullDataFormatException - if payload is too big