Class InMemoryKyberPreKeyStore
-
- All Implemented Interfaces:
-
org.signal.libsignal.protocol.state.KyberPreKeyStore
public class InMemoryKyberPreKeyStore implements KyberPreKeyStore
-
-
Constructor Summary
Constructors Constructor Description InMemoryKyberPreKeyStore()
-
Method Summary
Modifier and Type Method Description KyberPreKeyRecordloadKyberPreKey(int kyberPreKeyId)Load a local KyberPreKeyRecord. List<KyberPreKeyRecord>loadKyberPreKeys()Load all local KyberPreKeyRecords. voidstoreKyberPreKey(int kyberPreKeyId, KyberPreKeyRecord record)Store a local KyberPreKeyRecord. booleancontainsKyberPreKey(int kyberPreKeyId)voidmarkKyberPreKeyUsed(int kyberPreKeyId)Mark a KyberPreKeyRecord in the local storage as used. booleanhasKyberPreKeyBeenUsed(int kyberPreKeyId)-
-
Method Detail
-
loadKyberPreKey
KyberPreKeyRecord loadKyberPreKey(int kyberPreKeyId)
Load a local KyberPreKeyRecord.
- Parameters:
kyberPreKeyId- the ID of the local KyberPreKeyRecord.- Returns:
the corresponding KyberPreKeyRecord.
-
loadKyberPreKeys
List<KyberPreKeyRecord> loadKyberPreKeys()
Load all local KyberPreKeyRecords.
- Returns:
All stored KyberPreKeyRecords.
-
storeKyberPreKey
void storeKyberPreKey(int kyberPreKeyId, KyberPreKeyRecord record)
Store a local KyberPreKeyRecord.
- Parameters:
kyberPreKeyId- the ID of the KyberPreKeyRecord to store.record- the KyberPreKeyRecord.
-
containsKyberPreKey
boolean containsKyberPreKey(int kyberPreKeyId)
- Parameters:
kyberPreKeyId- A KyberPreKeyRecord ID.- Returns:
true if the store has a record for the kyberPreKeyId, otherwise false.
-
markKyberPreKeyUsed
void markKyberPreKeyUsed(int kyberPreKeyId)
Mark a KyberPreKeyRecord in the local storage as used.
Remove if it is a one-time pre key and noop if it is last-resort.
- Parameters:
kyberPreKeyId- The ID of the KyberPreKeyRecord to marked.
-
hasKyberPreKeyBeenUsed
boolean hasKyberPreKeyBeenUsed(int kyberPreKeyId)
-
-
-
-