T_IdKeyPair
- IdentityKeyPair classT_IdKey
- IdentityKey classT_PreKey
- PreKey classT_SigPreKey
- SignedPreKey classT_Sess
- Session classT_Addr
- Address classT_ECPub
- Elliptic Curve PublicKey classT_Bundle
- Bundle classT_Ciph
- Cipher classpublic abstract class OmemoStore<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> extends Object
Constructor and Description |
---|
OmemoStore()
Create a new OmemoStore.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
containsRawSession(OmemoManager omemoManager,
OmemoDevice device)
Return true, if we have a session with the device, otherwise false.
|
abstract void |
distrustOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
OmemoFingerprint fingerprint) |
void |
distrustOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
T_IdKey identityKey)
Distrust an OmemoIdentity.
|
T_IdKeyPair |
generateOmemoIdentityKeyPair()
Generate a new IdentityKeyPair.
|
HashMap<Integer,T_PreKey> |
generateOmemoPreKeys(int startId,
int count)
Generate 'count' new PreKeys beginning with id 'startId'.
|
T_SigPreKey |
generateOmemoSignedPreKey(T_IdKeyPair identityKeyPair,
int signedPreKeyId)
Generate a new signed preKey.
|
abstract Date |
getDateOfLastReceivedMessage(OmemoManager omemoManager,
OmemoDevice from)
Return the date in millis of the last message that was received from device 'from'.
|
abstract Date |
getDateOfLastSignedPreKeyRenewal(OmemoManager omemoManager)
Get the date in millis of the last time the signed preKey was renewed.
|
abstract int |
getDefaultDeviceId(org.jxmpp.jid.BareJid user)
Return the default deviceId for a user.
|
OmemoFingerprint |
getFingerprint(OmemoManager omemoManager)
Return our identityKeys fingerprint.
|
OmemoFingerprint |
getFingerprint(OmemoManager omemoManager,
OmemoDevice device)
Return the fingerprint of the given devices announced identityKey.
|
OmemoSession<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> |
getOmemoSessionOf(OmemoManager omemoManager,
OmemoDevice device)
Return the OmemoSession for the OmemoDevice.
|
abstract boolean |
isDecidedOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
OmemoFingerprint fingerprint) |
boolean |
isDecidedOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
T_IdKey identityKey)
Did the user yet made a decision about whether to trust or distrust this device?
|
abstract boolean |
isFreshInstallation(OmemoManager omemoManager)
Return true if this is a fresh installation.
|
abstract boolean |
isTrustedOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
OmemoFingerprint fingerprint) |
boolean |
isTrustedOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
T_IdKey identityKey)
Decide, whether a identityKey of a device is trusted or not.
|
abstract OmemoKeyUtil<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> |
keyUtil()
Return a concrete KeyUtil object that we can use as a utility to create keys etc.
|
abstract HashMap<Integer,T_Sess> |
loadAllRawSessionsOf(OmemoManager omemoManager,
org.jxmpp.jid.BareJid contact)
Load all crypto-lib specific session objects of contact 'contact'.
|
abstract CachedDeviceList |
loadCachedDeviceList(OmemoManager omemoManager,
org.jxmpp.jid.BareJid contact)
Load a list of deviceIds from contact 'contact' from the local cache.
|
abstract int |
loadCurrentSignedPreKeyId(OmemoManager omemoManager)
Return the id of the currently used signed preKey.
|
abstract int |
loadLastPreKeyId(OmemoManager omemoManager)
Return the id of the last generated preKey.
|
abstract T_IdKey |
loadOmemoIdentityKey(OmemoManager omemoManager,
OmemoDevice device)
Load the public identityKey of the device.
|
abstract T_IdKeyPair |
loadOmemoIdentityKeyPair(OmemoManager omemoManager)
Load our identityKeyPair from storage.
|
abstract T_PreKey |
loadOmemoPreKey(OmemoManager omemoManager,
int preKeyId)
Load the preKey with id 'preKeyId' from storage.
|
abstract HashMap<Integer,T_PreKey> |
loadOmemoPreKeys(OmemoManager omemoManager)
Return all our current OmemoPreKeys.
|
abstract T_SigPreKey |
loadOmemoSignedPreKey(OmemoManager omemoManager,
int signedPreKeyId)
Return the signedPreKey with the id 'singedPreKeyId'.
|
abstract HashMap<Integer,T_SigPreKey> |
loadOmemoSignedPreKeys(OmemoManager omemoManager)
Load all our signed PreKeys.
|
abstract T_Sess |
loadRawSession(OmemoManager omemoManager,
OmemoDevice device)
Load the crypto-lib specific session object of the device from storage.
|
abstract void |
purgeOwnDeviceKeys(OmemoManager omemoManager)
Delete this device's IdentityKey, PreKeys, SignedPreKeys and Sessions.
|
abstract void |
removeAllRawSessionsOf(OmemoManager omemoManager,
org.jxmpp.jid.BareJid contact)
Remove all crypto-lib specific session of a contact.
|
abstract void |
removeOmemoPreKey(OmemoManager omemoManager,
int preKeyId)
remove a preKey from storage.
|
abstract void |
removeOmemoSignedPreKey(OmemoManager omemoManager,
int signedPreKeyId)
Remove a signedPreKey from storage.
|
abstract void |
removeRawSession(OmemoManager omemoManager,
OmemoDevice device)
Remove a crypto-lib specific session from storage.
|
void |
setDateOfLastReceivedMessage(OmemoManager omemoManager,
OmemoDevice from)
Set the date in millis of the last message that was received from device 'from' to now.
|
abstract void |
setDateOfLastReceivedMessage(OmemoManager omemoManager,
OmemoDevice from,
Date date)
Set the date in millis of the last message that was received from device 'from' to 'date'.
|
void |
setDateOfLastSignedPreKeyRenewal(OmemoManager omemoManager)
Store the date of the last preKey renewal in the omemoStore.
|
abstract void |
setDateOfLastSignedPreKeyRenewal(OmemoManager omemoManager,
Date date)
Set the date in millis of the last time the signed preKey was renewed.
|
abstract void |
setDefaultDeviceId(org.jxmpp.jid.BareJid user,
int defaultDeviceId)
Set the default deviceId of a user.
|
abstract void |
storeCachedDeviceList(OmemoManager omemoManager,
org.jxmpp.jid.BareJid contact,
CachedDeviceList deviceList)
Store the DeviceList of the contact in local storage.
|
abstract void |
storeCurrentSignedPreKeyId(OmemoManager omemoManager,
int currentSignedPreKeyId)
Store the id of the currently used signedPreKey.
|
abstract void |
storeLastPreKeyId(OmemoManager omemoManager,
int currentPreKeyId)
Store the id of the last preKey we generated.
|
abstract void |
storeOmemoIdentityKey(OmemoManager omemoManager,
OmemoDevice device,
T_IdKey key)
Store the public identityKey of the device.
|
abstract void |
storeOmemoIdentityKeyPair(OmemoManager omemoManager,
T_IdKeyPair identityKeyPair)
Store our identityKeyPair in storage.
|
abstract void |
storeOmemoPreKey(OmemoManager omemoManager,
int preKeyId,
T_PreKey preKey)
Store a PreKey in storage.
|
void |
storeOmemoPreKeys(OmemoManager omemoManager,
HashMap<Integer,T_PreKey> preKeyHashMap)
Store a whole bunch of preKeys.
|
abstract void |
storeOmemoSignedPreKey(OmemoManager omemoManager,
int signedPreKeyId,
T_SigPreKey signedPreKey)
Store a signedPreKey in storage.
|
abstract void |
storeRawSession(OmemoManager omemoManager,
OmemoDevice device,
T_Sess session)
Store a crypto-lib specific session to storage.
|
abstract void |
trustOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
OmemoFingerprint identityKeyFingerprint) |
void |
trustOmemoIdentity(OmemoManager omemoManager,
OmemoDevice device,
T_IdKey identityKey)
Trust an OmemoIdentity.
|
public OmemoStore()
public abstract boolean isFreshInstallation(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public OmemoSession<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> getOmemoSessionOf(OmemoManager omemoManager, OmemoDevice device)
omemoManager
- omemoManager of our device.device
- OmemoDevicepublic abstract int loadLastPreKeyId(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public abstract void storeLastPreKeyId(OmemoManager omemoManager, int currentPreKeyId)
omemoManager
- omemoManager of our device.currentPreKeyId
- the id of the last generated PreKeypublic T_IdKeyPair generateOmemoIdentityKeyPair()
public abstract T_IdKeyPair loadOmemoIdentityKeyPair(OmemoManager omemoManager) throws CorruptedOmemoKeyException
omemoManager
- omemoManager of our device.CorruptedOmemoKeyException
- Thrown, if the stored key is damaged (*hands up* not my fault!)public abstract void storeOmemoIdentityKeyPair(OmemoManager omemoManager, T_IdKeyPair identityKeyPair)
omemoManager
- omemoManager of our device.identityKeyPair
- identityKeyPairpublic abstract T_IdKey loadOmemoIdentityKey(OmemoManager omemoManager, OmemoDevice device) throws CorruptedOmemoKeyException
omemoManager
- omemoManager of our device.device
- deviceCorruptedOmemoKeyException
- when the key in question is corrupted and cant be deserialized.public abstract void storeOmemoIdentityKey(OmemoManager omemoManager, OmemoDevice device, T_IdKey key)
omemoManager
- omemoManager of our device.device
- devicekey
- identityKeypublic boolean isTrustedOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, T_IdKey identityKey)
omemoManager
- omemoManager of our device.device
- Owner of the keyidentityKey
- identityKeypublic abstract boolean isTrustedOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, OmemoFingerprint fingerprint)
public boolean isDecidedOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, T_IdKey identityKey)
omemoManager
- omemoManager of our device.device
- deviceidentityKey
- IdentityKeypublic abstract boolean isDecidedOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, OmemoFingerprint fingerprint)
public void trustOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, T_IdKey identityKey)
omemoManager
- omemoManager of our device.device
- deviceidentityKey
- identityKeypublic abstract void trustOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, OmemoFingerprint identityKeyFingerprint)
public void distrustOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, T_IdKey identityKey)
omemoManager
- omemoManager of our device.device
- deviceidentityKey
- identityKeypublic abstract void distrustOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, OmemoFingerprint fingerprint)
public abstract void setDateOfLastReceivedMessage(OmemoManager omemoManager, OmemoDevice from, Date date)
omemoManager
- omemoManager of our device.from
- device in questiondate
- date of the last received messagepublic void setDateOfLastReceivedMessage(OmemoManager omemoManager, OmemoDevice from)
omemoManager
- omemoManager of our device.from
- device in questionpublic abstract Date getDateOfLastReceivedMessage(OmemoManager omemoManager, OmemoDevice from)
omemoManager
- omemoManager of our device.from
- device in questionpublic abstract void setDateOfLastSignedPreKeyRenewal(OmemoManager omemoManager, Date date)
omemoManager
- omemoManager of our device.date
- datepublic void setDateOfLastSignedPreKeyRenewal(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public abstract Date getDateOfLastSignedPreKeyRenewal(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public HashMap<Integer,T_PreKey> generateOmemoPreKeys(int startId, int count)
startId
- start idcount
- how many keys do we want to generatepublic abstract T_PreKey loadOmemoPreKey(OmemoManager omemoManager, int preKeyId)
omemoManager
- omemoManager of our device.preKeyId
- id of the key to be loadedpublic abstract void storeOmemoPreKey(OmemoManager omemoManager, int preKeyId, T_PreKey preKey)
omemoManager
- omemoManager of our device.preKeyId
- id of the keypreKey
- keypublic void storeOmemoPreKeys(OmemoManager omemoManager, HashMap<Integer,T_PreKey> preKeyHashMap)
omemoManager
- omemoManager of our device.preKeyHashMap
- HashMap of preKeyspublic abstract void removeOmemoPreKey(OmemoManager omemoManager, int preKeyId)
omemoManager
- omemoManager of our device.preKeyId
- id of the used key that will be deletedpublic abstract int loadCurrentSignedPreKeyId(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public abstract void storeCurrentSignedPreKeyId(OmemoManager omemoManager, int currentSignedPreKeyId)
omemoManager
- omemoManager of our device.currentSignedPreKeyId
- if of the signedPreKey that is currently in usepublic abstract HashMap<Integer,T_PreKey> loadOmemoPreKeys(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public abstract T_SigPreKey loadOmemoSignedPreKey(OmemoManager omemoManager, int signedPreKeyId)
omemoManager
- omemoManager of our device.signedPreKeyId
- id of the keypublic abstract HashMap<Integer,T_SigPreKey> loadOmemoSignedPreKeys(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public T_SigPreKey generateOmemoSignedPreKey(T_IdKeyPair identityKeyPair, int signedPreKeyId) throws CorruptedOmemoKeyException
identityKeyPair
- identityKeyPair used to sign the preKeysignedPreKeyId
- id that the preKey will haveCorruptedOmemoKeyException
- when something goes wrongpublic abstract void storeOmemoSignedPreKey(OmemoManager omemoManager, int signedPreKeyId, T_SigPreKey signedPreKey)
omemoManager
- omemoManager of our device.signedPreKeyId
- id of the signedPreKeysignedPreKey
- the key itselfpublic abstract void removeOmemoSignedPreKey(OmemoManager omemoManager, int signedPreKeyId)
omemoManager
- omemoManager of our device.signedPreKeyId
- id of the key that will be removedpublic abstract T_Sess loadRawSession(OmemoManager omemoManager, OmemoDevice device)
omemoManager
- omemoManager of our device.device
- device whose session we want to loadpublic abstract HashMap<Integer,T_Sess> loadAllRawSessionsOf(OmemoManager omemoManager, org.jxmpp.jid.BareJid contact)
omemoManager
- omemoManager of our device.contact
- BareJid of the contact we want to get all sessions frompublic abstract void storeRawSession(OmemoManager omemoManager, OmemoDevice device, T_Sess session)
omemoManager
- omemoManager of our device.device
- OmemoDevice whose session we want to storesession
- sessionpublic abstract void removeRawSession(OmemoManager omemoManager, OmemoDevice device)
omemoManager
- omemoManager of our device.device
- device whose session we want to deletepublic abstract void removeAllRawSessionsOf(OmemoManager omemoManager, org.jxmpp.jid.BareJid contact)
omemoManager
- omemoManager of our device.contact
- BareJid of the contactpublic abstract boolean containsRawSession(OmemoManager omemoManager, OmemoDevice device)
omemoManager
- omemoManager of our device.device
- devicepublic abstract CachedDeviceList loadCachedDeviceList(OmemoManager omemoManager, org.jxmpp.jid.BareJid contact)
omemoManager
- omemoManager of our device.contact
- contact we want to get the deviceList ofpublic abstract void storeCachedDeviceList(OmemoManager omemoManager, org.jxmpp.jid.BareJid contact, CachedDeviceList deviceList)
omemoManager
- omemoManager of our device.contact
- ContactdeviceList
- list of the contacts devices' ids.public abstract void purgeOwnDeviceKeys(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public abstract OmemoKeyUtil<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> keyUtil()
public OmemoFingerprint getFingerprint(OmemoManager omemoManager)
omemoManager
- omemoManager of our device.public abstract int getDefaultDeviceId(org.jxmpp.jid.BareJid user)
user
- userpublic abstract void setDefaultDeviceId(org.jxmpp.jid.BareJid user, int defaultDeviceId)
user
- userdefaultDeviceId
- defaultDeviceIdpublic OmemoFingerprint getFingerprint(OmemoManager omemoManager, OmemoDevice device) throws CannotEstablishOmemoSessionException
omemoManager
- omemoManager of our device.device
- deviceCannotEstablishOmemoSessionException
- if we cannot establish a session