diff options
author | Moxie Marlinspike <moxie@thoughtcrime.org> | 2014-11-24 12:54:30 -0800 |
---|---|---|
committer | Moxie Marlinspike <moxie@thoughtcrime.org> | 2014-11-24 12:54:30 -0800 |
commit | 60800e155612bea797eed93c67046a23d26054cc (patch) | |
tree | d88368c1c26162e27e790195133ca2b526597afe /src/main/java/org/whispersystems/libaxolotl/state/SignedPreKeyStore.java |
Break out into separate repo.
Diffstat (limited to 'src/main/java/org/whispersystems/libaxolotl/state/SignedPreKeyStore.java')
-rw-r--r-- | src/main/java/org/whispersystems/libaxolotl/state/SignedPreKeyStore.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/org/whispersystems/libaxolotl/state/SignedPreKeyStore.java b/src/main/java/org/whispersystems/libaxolotl/state/SignedPreKeyStore.java new file mode 100644 index 00000000..c828bf23 --- /dev/null +++ b/src/main/java/org/whispersystems/libaxolotl/state/SignedPreKeyStore.java @@ -0,0 +1,47 @@ +package org.whispersystems.libaxolotl.state; + +import org.whispersystems.libaxolotl.InvalidKeyIdException; + +import java.util.List; + +public interface SignedPreKeyStore { + + + /** + * Load a local SignedPreKeyRecord. + * + * @param signedPreKeyId the ID of the local SignedPreKeyRecord. + * @return the corresponding SignedPreKeyRecord. + * @throws InvalidKeyIdException when there is no corresponding SignedPreKeyRecord. + */ + public SignedPreKeyRecord loadSignedPreKey(int signedPreKeyId) throws InvalidKeyIdException; + + /** + * Load all local SignedPreKeyRecords. + * + * @return All stored SignedPreKeyRecords. + */ + public List<SignedPreKeyRecord> loadSignedPreKeys(); + + /** + * Store a local SignedPreKeyRecord. + * + * @param signedPreKeyId the ID of the SignedPreKeyRecord to store. + * @param record the SignedPreKeyRecord. + */ + public void storeSignedPreKey(int signedPreKeyId, SignedPreKeyRecord record); + + /** + * @param signedPreKeyId A SignedPreKeyRecord ID. + * @return true if the store has a record for the signedPreKeyId, otherwise false. + */ + public boolean containsSignedPreKey(int signedPreKeyId); + + /** + * Delete a SignedPreKeyRecord from local storage. + * + * @param signedPreKeyId The ID of the SignedPreKeyRecord to remove. + */ + public void removeSignedPreKey(int signedPreKeyId); + +} |