Class 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
      Packet clone()
      Creates a copy of the Packet
      boolean eq​(Packet b)
      Checks if two Packets contain equal inner contents.
      boolean equals​(Object o)  
      protected void finalize()  
      byte[] get_hmac()
      HMAC to verify the integrity of hop_data
      byte[] 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_data
      byte get_version()
      Bolt 04 version number
      static Packet of​(byte version_arg, byte[] public_key_arg, byte[] hop_data_arg, byte[] hmac_arg)
      Constructs a new Packet given each field
      void set_hmac​(byte[] val)
      HMAC to verify the integrity of hop_data
      void set_hop_data​(byte[] val)
      Encrypted payload for the next hop
      void set_public_key​(byte[] val)
      A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
      void set_version​(byte val)
      Bolt 04 version number
      byte[] write()
      Serialize the Packet object into a byte array which can be read by Packet_read
    • Method Detail

      • 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
      • clone

        public Packet clone()
        Creates a copy of the Packet
        Overrides:
        clone in class Object
      • 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