Class SessionRecord
-
- All Implemented Interfaces:
-
org.signal.libsignal.internal.NativeHandleGuard.Owner
public class SessionRecord extends NativeHandleGuard.SimpleOwner
A SessionRecord encapsulates the state of an ongoing session.
Moxie Marlinspike
-
-
Constructor Summary
Constructors Constructor Description SessionRecord()SessionRecord(Array<byte> serialized)
-
Method Summary
Modifier and Type Method Description voidarchiveCurrentState()Move the current SessionState into the list of "previous" session states, and replace the current SessionState with a fresh reset instance. intgetSessionVersion()intgetRemoteRegistrationId()intgetLocalRegistrationId()IdentityKeygetRemoteIdentityKey()IdentityKeygetLocalIdentityKey()booleanhasSenderChain()Returns whether the current session can be used to send messages. booleanhasSenderChain(Instant now)Returns whether the current session can be used to send messages. booleancurrentRatchetKeyMatches(ECPublicKey key)Array<byte>serialize()-
Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.SimpleOwner
unsafeNativeHandleWithoutGuard -
Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.Owner
guard, guardedMap, guardedMapChecked, guardedRun, guardedRunChecked -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SessionRecord
SessionRecord()
-
SessionRecord
SessionRecord(Array<byte> serialized)
-
-
Method Detail
-
archiveCurrentState
void archiveCurrentState()
Move the current SessionState into the list of "previous" session states, and replace the current SessionState with a fresh reset instance.
-
getSessionVersion
int getSessionVersion()
-
getRemoteRegistrationId
int getRemoteRegistrationId()
-
getLocalRegistrationId
int getLocalRegistrationId()
-
getRemoteIdentityKey
IdentityKey getRemoteIdentityKey()
-
getLocalIdentityKey
IdentityKey getLocalIdentityKey()
-
hasSenderChain
boolean hasSenderChain()
Returns whether the current session can be used to send messages.
If there is no current session, returns
false.
-
hasSenderChain
boolean hasSenderChain(Instant now)
Returns whether the current session can be used to send messages.
If there is no current session, returns
false.You should only use this overload if you need to test session expiration.
-
currentRatchetKeyMatches
boolean currentRatchetKeyMatches(ECPublicKey key)
-
-
-
-