Package 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
A X25519 key and key ID.
- Since:
- 0.9.44
-
Field Summary
-
Constructor Summary
Constructors Constructor 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
Modifier and Type Method 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, toTypedKey
Methods inherited from class net.i2p.data.SimpleDataStructure
calculateHash, fromBase64, fromByteArray, getData, read, readBytes, setData, toBase64, toByteArray, writeBytes
-
Constructor Details
-
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().- Since:
- 0.9.46
-
-
Method Details
-
getID
public int getID() -
isReverse
public boolean isReverse()- Since:
- 0.9.46
-
isRequest
public boolean isRequest()- Since:
- 0.9.46
-
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. -
equals
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? -
toString
-