Package org.ldk.structs
Class Packet
- java.lang.Object
-
- org.ldk.structs.Packet
-
public class Packet extends Object
Packet of hop data for next peer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Packetclone()Creates a copy of the Packetbooleaneq(Packet b)Checks if two Packets contain equal inner contents.booleanequals(Object o)protected voidfinalize()byte[]get_hmac()HMAC to verify the integrity of hop_databyte[]get_hop_data()Encrypted payload for the next hop Returns a copy of the field.byte[]get_public_key()A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_databyteget_version()Bolt 04 version numberstatic Packetof(byte version_arg, byte[] public_key_arg, byte[] hop_data_arg, byte[] hmac_arg)Constructs a new Packet given each fieldvoidset_hmac(byte[] val)HMAC to verify the integrity of hop_datavoidset_hop_data(byte[] val)Encrypted payload for the next hopvoidset_public_key(byte[] val)A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_datavoidset_version(byte val)Bolt 04 version numberbyte[]write()Serialize the Packet object into a byte array which can be read by Packet_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_version
public byte get_version()
Bolt 04 version number
-
set_version
public void set_version(byte val)
Bolt 04 version number
-
get_public_key
public byte[] get_public_key()
A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
-
set_public_key
public void set_public_key(byte[] val)
A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
-
get_hop_data
public byte[] get_hop_data()
Encrypted payload for the next hop Returns a copy of the field.
-
set_hop_data
public void set_hop_data(byte[] val)
Encrypted payload for the next hop
-
get_hmac
public byte[] get_hmac()
HMAC to verify the integrity of hop_data
-
set_hmac
public void set_hmac(byte[] val)
HMAC to verify the integrity of hop_data
-
of
public static Packet of(byte version_arg, byte[] public_key_arg, byte[] hop_data_arg, byte[] hmac_arg)
Constructs a new Packet given each field
-
eq
public boolean eq(Packet b)
Checks if two Packets contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
write
public byte[] write()
Serialize the Packet object into a byte array which can be read by Packet_read
-
-