Interface KyberPreKeyStore
-
- All Implemented Interfaces:
@CalledFromNative() public interface KyberPreKeyStore
-
-
Method Summary
Modifier and Type Method Description abstract KyberPreKeyRecordloadKyberPreKey(int kyberPreKeyId)Load a local KyberPreKeyRecord. abstract List<KyberPreKeyRecord>loadKyberPreKeys()Load all local KyberPreKeyRecords. abstract voidstoreKyberPreKey(int kyberPreKeyId, KyberPreKeyRecord record)Store a local KyberPreKeyRecord. abstract booleancontainsKyberPreKey(int kyberPreKeyId)abstract voidmarkKyberPreKeyUsed(int kyberPreKeyId, int signedPreKeyId, ECPublicKey baseKey)Mark a KyberPreKeyRecord in the local storage as used. -
-
Method Detail
-
loadKyberPreKey
abstract KyberPreKeyRecord loadKyberPreKey(int kyberPreKeyId)
Load a local KyberPreKeyRecord.
- Parameters:
kyberPreKeyId- the ID of the local KyberPreKeyRecord.- Returns:
the corresponding KyberPreKeyRecord.
-
loadKyberPreKeys
abstract List<KyberPreKeyRecord> loadKyberPreKeys()
Load all local KyberPreKeyRecords.
- Returns:
All stored KyberPreKeyRecords.
-
storeKyberPreKey
abstract void storeKyberPreKey(int kyberPreKeyId, KyberPreKeyRecord record)
Store a local KyberPreKeyRecord.
- Parameters:
kyberPreKeyId- the ID of the KyberPreKeyRecord to store.record- the KyberPreKeyRecord.
-
containsKyberPreKey
abstract boolean containsKyberPreKey(int kyberPreKeyId)
- Parameters:
kyberPreKeyId- A KyberPreKeyRecord ID.- Returns:
true if the store has a record for the kyberPreKeyId, otherwise false.
-
markKyberPreKeyUsed
abstract void markKyberPreKeyUsed(int kyberPreKeyId, int signedPreKeyId, ECPublicKey baseKey)
Mark a KyberPreKeyRecord in the local storage as used.
If it's a one-time pre-key, remove it.
If it's a last-resort pre-key, check whether this specific
(kyberPreKeyId, signedPreKeyId, baseKey)tuple has been seen before, and throw an exception if so. If not, record it for later. Entries can be removed when either the Kyber key or the last-resort key is deleted (not just rotated).- Parameters:
kyberPreKeyId- The ID of the KyberPreKeyRecord to be marked.signedPreKeyId- The ID of the SignedPreKeyRecord that was used with this Kyber pre-key.baseKey- The session-specific key from the sender used with this Kyber pre-key.
-
-
-
-