net.i2p.router.crypto.ratchet

## Class NextSessionKey

- java.lang.Object
- - net.i2p.data.SimpleDataStructure
  - - net.i2p.data.PublicKey
    - - net.i2p.router.crypto.ratchet.NextSessionKey

- All Implemented Interfaces:
    DataStructure

      class NextSessionKey
      extends PublicKey

  X25519 public key with identifier for next session key exchange in ratchet protocol

- - ### Field Summary

    - ### Fields inherited from class net.i2p.data.PublicKey

      `KEYSIZE_BYTES`

    - ### Fields inherited from class net.i2p.data.SimpleDataStructure

      `_data`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NextSessionKey(byte[] data, int id, boolean isReverse, boolean isRequest)`
    `NextSessionKey(int id, boolean isReverse, boolean isRequest)` Null data, for acks/requests only.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)` Warning - this returns true for two different classes with the same size and same data, e.g.
    `int` | `getID()`
    `int` | `hashCode()` We assume the data has enough randomness in it, so use the first 4 bytes for speed.
    `boolean` | `isRequest()`
    `boolean` | `isReverse()`
    `String` | `toString()`

    - ### Methods inherited from class net.i2p.data.PublicKey

      `clearCache, create, create, getPadding, getType, getUnknownTypeCode, length`

    - ### Methods inherited from class net.i2p.data.SimpleDataStructure

      `calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytes`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NextSessionKey

          public NextSessionKey(byte[] data,
                                int id,
                                boolean isReverse,
                                boolean isRequest)

      Parameters:
        `data` - non-null

    - #### NextSessionKey

          public NextSessionKey(int id,
                                boolean isReverse,
                                boolean isRequest)

      Null data, for acks/requests only. Type will be ElG but doesn't matter. Don't call setData().

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Description copied from class: `SimpleDataStructure`
      Warning - this returns true for two different classes with the same size and same data, e.g. SessionKey and SessionTag, but you wouldn't put them in the same Set, would you?
      Overrides:
        `equals` in class `PublicKey`

    - #### getID

          public int getID()

    - #### hashCode

          public int hashCode()

      Description copied from class: `SimpleDataStructure`
      We assume the data has enough randomness in it, so use the first 4 bytes for speed. If this is not the case, override in the extending class.
      Overrides:
        `hashCode` in class `PublicKey`

    - #### isRequest

          public boolean isRequest()

    - #### isReverse

          public boolean isReverse()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `PublicKey`