class RatchetTagSet extends Object implements TagSetHandle
Modifier and Type | Field and Description |
---|---|
protected SessionKey |
_key |
(package private) static int |
DEBUG_IB_NSR |
(package private) static int |
DEBUG_OB_NSR |
(package private) static int |
DEBUG_SINGLE_ES |
Modifier | Constructor and Description |
---|---|
|
RatchetTagSet(HKDF hkdf,
HandshakeState state,
SessionKey rootKey,
SessionKey data,
long date)
Outbound NSR Tagset
|
|
RatchetTagSet(HKDF hkdf,
SessionKey rootKey,
SessionKey data,
long date,
int tagsetid,
int keyid)
Outbound ES Tagset
|
|
RatchetTagSet(HKDF hkdf,
SessionTagListener lsnr,
HandshakeState state,
SessionKey rootKey,
SessionKey data,
long date,
int minSize,
int maxSize)
Inbound NSR Tagset
|
|
RatchetTagSet(HKDF hkdf,
SessionTagListener lsnr,
PublicKey remoteKey,
SessionKey rootKey,
SessionKey data,
long date,
int tagsetid,
int keyid,
int minSize,
int maxSize)
Inbound ES Tagset
|
protected |
RatchetTagSet(SessionTagListener lsnr,
SessionKey rootKey,
long date,
long timeout)
For SingleTagSet
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
SessionKeyAndNonce |
consume(RatchetSessionTag tag)
inbound only
|
RatchetSessionTag |
consumeNext()
Public for outbound only.
|
SessionKeyAndNonce |
consumeNextKey()
For outbound, call after consumeNextTag().
|
boolean |
getAcked()
For inbound, returns true after first consume() call.
|
SessionKey |
getAssociatedKey()
The root key for the tag set.
|
long |
getCreated()
For inbound and outbound: creation time, for debugging only
|
long |
getDate()
For inbound and outbound: last used time
Expiration is getDate() + getTimeout().
|
int |
getDebugID()
A unique ID for debugging only
|
long |
getExpiration()
For inbound and outbound: Expiration.
|
HandshakeState |
getHandshakeState()
For inbound/outbound NSR only, else null.
|
int |
getID()
The TagSet ID, starting at 0.
|
NextSessionKey |
getNextKey()
Next Forward Key if applicable (outbound ES and we're running low).
|
KeyPair |
getNextKeys()
Next Forward KeyPair if applicable (we're running low).
|
SessionKey |
getNextRootKey()
Root key for the next DH ratchet.
|
PublicKey |
getRemoteKey()
The far-end's public key.
|
long |
getTimeout()
For inbound and outbound: Idle timeout interval.
|
int |
remaining()
tags remaining
|
void |
setDate(long when)
For inbound and outbound: last used time
|
int |
size()
unused tags generated
|
String |
toString() |
protected final SessionKey _key
static final int DEBUG_OB_NSR
static final int DEBUG_IB_NSR
static final int DEBUG_SINGLE_ES
public RatchetTagSet(HKDF hkdf, HandshakeState state, SessionKey rootKey, SessionKey data, long date)
date
- For outbound: creation timepublic RatchetTagSet(HKDF hkdf, SessionKey rootKey, SessionKey data, long date, int tagsetid, int keyid)
date
- For outbound: creation timepublic RatchetTagSet(HKDF hkdf, SessionTagListener lsnr, HandshakeState state, SessionKey rootKey, SessionKey data, long date, int minSize, int maxSize)
date
- For inbound: creation timepublic RatchetTagSet(HKDF hkdf, SessionTagListener lsnr, PublicKey remoteKey, SessionKey rootKey, SessionKey data, long date, int tagsetid, int keyid, int minSize, int maxSize)
date
- For inbound: creation timeprotected RatchetTagSet(SessionTagListener lsnr, SessionKey rootKey, long date, long timeout)
public void clear()
public PublicKey getRemoteKey()
public SessionKey getAssociatedKey()
public HandshakeState getHandshakeState()
public long getDate()
public void setDate(long when)
public long getCreated()
public long getTimeout()
public long getExpiration()
public int size()
public int remaining()
public NextSessionKey getNextKey()
public KeyPair getNextKeys()
public SessionKey getNextRootKey()
public SessionKeyAndNonce consume(RatchetSessionTag tag)
public RatchetSessionTag consumeNext()
public SessionKeyAndNonce consumeNextKey()
public boolean getAcked()
public int getID()
public int getDebugID()