Package net.i2p.router.crypto.ratchet
Class SessionKeyAndNonce
- java.lang.Object
-
- net.i2p.data.SimpleDataStructure
-
- net.i2p.data.SessionKey
-
- net.i2p.router.crypto.ratchet.SessionKeyAndNonce
-
- All Implemented Interfaces:
DataStructure
class SessionKeyAndNonce extends SessionKey
A session key is 32 bytes of data. Nonce should be 65535 or less. This is what is returned from RatchetTagSet.consume(). RatchetSKM puts it in a RatchetEntry and returns it to ECIESAEADEngine.- Since:
- 0.9.44
-
-
Field Summary
-
Fields inherited from class net.i2p.data.SessionKey
INVALID_KEY, KEYSIZE_BYTES
-
Fields inherited from class net.i2p.data.SimpleDataStructure
_data
-
-
Constructor Summary
Constructors Constructor Description SessionKeyAndNonce(byte[] data, int nonce)For outbound Existing SessionSessionKeyAndNonce(byte[] data, int id, int nonce, PublicKey remoteKey)For inbound Existing SessionSessionKeyAndNonce(HandshakeState state)For New Session Replies
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandshakeStategetHandshakeState()For inbound NSR only, else null.intgetID()For inbound ES, else 0intgetNonce()For ES, else 0PublicKeygetRemoteKey()For inbound ES, else null.StringtoString()-
Methods inherited from class net.i2p.data.SessionKey
getPreparedKey, length, setData, setPreparedKey
-
Methods inherited from class net.i2p.data.SimpleDataStructure
calculateHash, equals, fromBase64, fromByteArray, getData, hashCode, read, readBytes, toBase64, toByteArray, writeBytes
-
-
-
-
Constructor Detail
-
SessionKeyAndNonce
public SessionKeyAndNonce(byte[] data, int nonce)For outbound Existing Session
-
SessionKeyAndNonce
public SessionKeyAndNonce(byte[] data, int id, int nonce, PublicKey remoteKey)For inbound Existing Session- Since:
- 0.9.46
-
SessionKeyAndNonce
public SessionKeyAndNonce(HandshakeState state)
For New Session Replies
-
-
Method Detail
-
getNonce
public int getNonce()
For ES, else 0
-
getID
public int getID()
For inbound ES, else 0- Since:
- 0.9.46
-
getRemoteKey
public PublicKey getRemoteKey()
For inbound ES, else null. For NSR, use getHansdhakeState().getRemotePublicKey().getPublicKey().- Since:
- 0.9.46
-
getHandshakeState
public HandshakeState getHandshakeState()
For inbound NSR only, else null. MUST be cloned before processing NSR.
-
toString
public String toString()
- Overrides:
toStringin classSimpleDataStructure
-
-