Package org.jivesoftware.smackx.omemo
Class OmemoStore<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph>
- java.lang.Object
-
- org.jivesoftware.smackx.omemo.OmemoStore<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph>
-
- Type Parameters:
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 class
- Direct Known Subclasses:
CachingOmemoStore
,FileBasedOmemoStore
,SignalOmemoStore
public abstract class OmemoStore<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> extends java.lang.Object
Class that presents some methods that are used to load/generate/store keys and session data needed for OMEMO.
-
-
Constructor Summary
Constructors Constructor Description OmemoStore()
Create a new OmemoStore.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
containsRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice)
Return true, if we have a session with the device, otherwise false.T_IdKeyPair
generateOmemoIdentityKeyPair()
Generate a new IdentityKeyPair.java.util.TreeMap<java.lang.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 java.util.Date
getDateOfLastDeviceIdPublication(OmemoDevice userDevice, OmemoDevice contactsDevice)
Return the date of the last time the deviceId was published after previously being not published.abstract java.util.Date
getDateOfLastReceivedMessage(OmemoDevice userDevice, OmemoDevice contactsDevice)
Return the date of the last message that was received from device 'from'.abstract java.util.Date
getDateOfLastSignedPreKeyRenewal(OmemoDevice userDevice)
Get the date of the last time the signed preKey was renewed.OmemoFingerprint
getFingerprint(OmemoDevice userDevice)
Return our identityKeys fingerprint.OmemoFingerprint
getFingerprint(OmemoDevice userDevice, OmemoDevice contactsDevice)
Return the fingerprint of the identityKey belonging to contactsDevice.OmemoFingerprint
getFingerprintAndMaybeBuildSession(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice contactsDevice)
Return the fingerprint of the given devices announced identityKey.abstract OmemoKeyUtil<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_ECPub,T_Bundle>
keyUtil()
Return a concrete KeyUtil object that we can use as a utility to create keys etc.abstract java.util.HashMap<java.lang.Integer,T_Sess>
loadAllRawSessionsOf(OmemoDevice userDevice, BareJid contact)
Load all crypto-lib specific session objects of contact 'contact'.OmemoCachedDeviceList
loadCachedDeviceList(OmemoDevice userDevice)
Load a list of deviceIds from our own devices.abstract OmemoCachedDeviceList
loadCachedDeviceList(OmemoDevice userDevice, BareJid contact)
Load a list of deviceIds from contact 'contact' from the local cache.int
loadCurrentOmemoSignedPreKeyId(OmemoDevice userDevice)
abstract T_IdKey
loadOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice)
Load the public identityKey of a device.abstract T_IdKeyPair
loadOmemoIdentityKeyPair(OmemoDevice userDevice)
Load our identityKeyPair from storage.abstract int
loadOmemoMessageCounter(OmemoDevice userDevice, OmemoDevice contactsDevice)
Return the current value of the message counter.abstract T_PreKey
loadOmemoPreKey(OmemoDevice userDevice, int preKeyId)
Load the preKey with id 'preKeyId' from storage.abstract java.util.TreeMap<java.lang.Integer,T_PreKey>
loadOmemoPreKeys(OmemoDevice userDevice)
Return all our current OmemoPreKeys.abstract T_SigPreKey
loadOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId)
Return the signedPreKey with the id 'singedPreKeyId'.abstract java.util.TreeMap<java.lang.Integer,T_SigPreKey>
loadOmemoSignedPreKeys(OmemoDevice userDevice)
Load all our signed PreKeys.abstract T_Sess
loadRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice)
Load the crypto-lib specific session object of the device from storage.abstract java.util.SortedSet<java.lang.Integer>
localDeviceIdsOf(BareJid localUser)
Returns a sorted set of all the deviceIds, the localUser has had data stored under in the store.abstract void
purgeOwnDeviceKeys(OmemoDevice userDevice)
Delete this device's IdentityKey, PreKeys, SignedPreKeys and Sessions.abstract void
removeAllRawSessionsOf(OmemoDevice userDevice, BareJid contact)
Remove all crypto-lib specific session of a contact.abstract void
removeOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice)
Removes the identityKey of a device.abstract void
removeOmemoIdentityKeyPair(OmemoDevice userDevice)
Remove the identityKeyPair of a user.abstract void
removeOmemoPreKey(OmemoDevice userDevice, int preKeyId)
Remove a preKey from storage.abstract void
removeOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId)
Remove a signedPreKey from storage.abstract void
removeRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice)
Remove a crypto-lib specific session from storage.void
replenishKeys(OmemoDevice userDevice)
Replenish our supply of keys.abstract void
setDateOfLastDeviceIdPublication(OmemoDevice userDevice, OmemoDevice contactsDevice, java.util.Date date)
Set the date of the last time the deviceId was published.abstract void
setDateOfLastReceivedMessage(OmemoDevice userDevice, OmemoDevice contactsDevice, java.util.Date date)
Set the date of the last message that was received from a device.abstract void
setDateOfLastSignedPreKeyRenewal(OmemoDevice userDevice, java.util.Date date)
Set the date of the last time the signed preKey was renewed.abstract void
storeCachedDeviceList(OmemoDevice userDevice, BareJid contact, OmemoCachedDeviceList contactsDeviceList)
Store the DeviceList of the contact in local storage.abstract void
storeOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice, T_IdKey contactsKey)
Store the public identityKey of the device.abstract void
storeOmemoIdentityKeyPair(OmemoDevice userDevice, T_IdKeyPair identityKeyPair)
Store our identityKeyPair in storage.abstract void
storeOmemoMessageCounter(OmemoDevice userDevice, OmemoDevice contactsDevice, int counter)
Store the number of messages we sent to a device since we last received a message back.abstract void
storeOmemoPreKey(OmemoDevice userDevice, int preKeyId, T_PreKey preKey)
Store a PreKey in storage.void
storeOmemoPreKeys(OmemoDevice userDevice, java.util.TreeMap<java.lang.Integer,T_PreKey> preKeyHashMap)
Store a whole bunch of preKeys.abstract void
storeOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId, T_SigPreKey signedPreKey)
Store a signedPreKey in storage.abstract void
storeRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice, T_Sess session)
Store a crypto-lib specific session to storage.
-
-
-
Constructor Detail
-
OmemoStore
public OmemoStore()
Create a new OmemoStore.
-
-
Method Detail
-
localDeviceIdsOf
public abstract java.util.SortedSet<java.lang.Integer> localDeviceIdsOf(BareJid localUser)
Returns a sorted set of all the deviceIds, the localUser has had data stored under in the store. Basically this returns the deviceIds of all "accounts" of localUser, which are known to the store.- Parameters:
localUser
- BareJid of the user.- Returns:
- set of deviceIds with available data.
-
replenishKeys
public void replenishKeys(OmemoDevice userDevice) throws CorruptedOmemoKeyException, java.io.IOException
Replenish our supply of keys. If we are missing any type of keys, generate them fresh.- Parameters:
userDevice
- our own OMEMO device- Throws:
CorruptedOmemoKeyException
- if the OMEMO key is corrupted.java.io.IOException
- if an I/O error occurred.
-
generateOmemoIdentityKeyPair
public T_IdKeyPair generateOmemoIdentityKeyPair()
Generate a new IdentityKeyPair. We should always have only one pair and usually keep this for a long time.- Returns:
- a fresh identityKeyPair
-
loadOmemoIdentityKeyPair
public abstract T_IdKeyPair loadOmemoIdentityKeyPair(OmemoDevice userDevice) throws CorruptedOmemoKeyException, java.io.IOException
Load our identityKeyPair from storage. Return null, if we have no identityKeyPair.- Parameters:
userDevice
- our OmemoDevice.- Returns:
- loaded identityKeyPair
- Throws:
CorruptedOmemoKeyException
- Thrown, if the stored key is damaged (*hands up* not my fault!)java.io.IOException
- if an I/O error occurred.
-
storeOmemoIdentityKeyPair
public abstract void storeOmemoIdentityKeyPair(OmemoDevice userDevice, T_IdKeyPair identityKeyPair) throws java.io.IOException
Store our identityKeyPair in storage. It would be a cool feature, if the key could be stored in a encrypted database or something similar.- Parameters:
userDevice
- our OmemoDevice.identityKeyPair
- identityKeyPair- Throws:
java.io.IOException
- if an I/O error occurred.
-
removeOmemoIdentityKeyPair
public abstract void removeOmemoIdentityKeyPair(OmemoDevice userDevice)
Remove the identityKeyPair of a user.- Parameters:
userDevice
- our device.
-
loadOmemoIdentityKey
public abstract T_IdKey loadOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice) throws CorruptedOmemoKeyException, java.io.IOException
Load the public identityKey of a device.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- the device of which we want to load the identityKey.- Returns:
- loaded identityKey
- Throws:
CorruptedOmemoKeyException
- when the key in question is corrupted and cant be deserialized.java.io.IOException
- if an I/O error occurred.
-
storeOmemoIdentityKey
public abstract void storeOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice, T_IdKey contactsKey) throws java.io.IOException
Store the public identityKey of the device.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- device.contactsKey
- identityKey belonging to the contactsDevice.- Throws:
java.io.IOException
- if an I/O error occurred.
-
removeOmemoIdentityKey
public abstract void removeOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice)
Removes the identityKey of a device.- Parameters:
userDevice
- our omemoDevice.contactsDevice
- device of which we want to delete the identityKey.
-
storeOmemoMessageCounter
public abstract void storeOmemoMessageCounter(OmemoDevice userDevice, OmemoDevice contactsDevice, int counter) throws java.io.IOException
Store the number of messages we sent to a device since we last received a message back. This counter gets reset to 0 whenever we receive a message from the contacts device.- Parameters:
userDevice
- our omemoDevice.contactsDevice
- device of which we want to set the message counter.counter
- counter value.- Throws:
java.io.IOException
- if an I/O error occurred.
-
loadOmemoMessageCounter
public abstract int loadOmemoMessageCounter(OmemoDevice userDevice, OmemoDevice contactsDevice) throws java.io.IOException
Return the current value of the message counter. This counter represents the number of message we sent to the contactsDevice without getting a reply back. The default value for this counter is 0.- Parameters:
userDevice
- our omemoDevicecontactsDevice
- device of which we want to get the message counter.- Returns:
- counter value.
- Throws:
java.io.IOException
- if an I/O error occurred.
-
setDateOfLastReceivedMessage
public abstract void setDateOfLastReceivedMessage(OmemoDevice userDevice, OmemoDevice contactsDevice, java.util.Date date) throws java.io.IOException
Set the date of the last message that was received from a device.- Parameters:
userDevice
- omemoManager of our device.contactsDevice
- device in questiondate
- date of the last received message- Throws:
java.io.IOException
- if an I/O error occurred.
-
getDateOfLastReceivedMessage
public abstract java.util.Date getDateOfLastReceivedMessage(OmemoDevice userDevice, OmemoDevice contactsDevice) throws java.io.IOException
Return the date of the last message that was received from device 'from'.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- device in question- Returns:
- date if existent, null
- Throws:
java.io.IOException
- if an I/O error occurred.
-
setDateOfLastDeviceIdPublication
public abstract void setDateOfLastDeviceIdPublication(OmemoDevice userDevice, OmemoDevice contactsDevice, java.util.Date date) throws java.io.IOException
Set the date of the last time the deviceId was published. This method only gets called, when the deviceId was inactive/non-existent before it was published.- Parameters:
userDevice
- our OmemoDevicecontactsDevice
- OmemoDevice in questiondate
- date of the last publication after not being published- Throws:
java.io.IOException
- if an I/O error occurred.
-
getDateOfLastDeviceIdPublication
public abstract java.util.Date getDateOfLastDeviceIdPublication(OmemoDevice userDevice, OmemoDevice contactsDevice) throws java.io.IOException
Return the date of the last time the deviceId was published after previously being not published. (Point in time, where the status of the deviceId changed from inactive/non-existent to active).- Parameters:
userDevice
- our OmemoDevicecontactsDevice
- OmemoDevice in question- Returns:
- date of the last publication after not being published
- Throws:
java.io.IOException
- if an I/O error occurred.
-
setDateOfLastSignedPreKeyRenewal
public abstract void setDateOfLastSignedPreKeyRenewal(OmemoDevice userDevice, java.util.Date date) throws java.io.IOException
Set the date of the last time the signed preKey was renewed.- Parameters:
userDevice
- our OmemoDevice.date
- date- Throws:
java.io.IOException
- if an I/O error occurred.
-
getDateOfLastSignedPreKeyRenewal
public abstract java.util.Date getDateOfLastSignedPreKeyRenewal(OmemoDevice userDevice) throws java.io.IOException
Get the date of the last time the signed preKey was renewed.- Parameters:
userDevice
- our OmemoDevice.- Returns:
- date if existent, otherwise null
- Throws:
java.io.IOException
- if an I/O error occurred.
-
generateOmemoPreKeys
public java.util.TreeMap<java.lang.Integer,T_PreKey> generateOmemoPreKeys(int startId, int count)
Generate 'count' new PreKeys beginning with id 'startId'. These preKeys are published and can be used by contacts to establish sessions with us.- Parameters:
startId
- start idcount
- how many keys do we want to generate- Returns:
- Map of new preKeys
-
loadOmemoPreKey
public abstract T_PreKey loadOmemoPreKey(OmemoDevice userDevice, int preKeyId) throws java.io.IOException
Load the preKey with id 'preKeyId' from storage.- Parameters:
userDevice
- our OmemoDevice.preKeyId
- id of the key to be loaded- Returns:
- loaded preKey
- Throws:
java.io.IOException
- if an I/O error occurred.
-
storeOmemoPreKey
public abstract void storeOmemoPreKey(OmemoDevice userDevice, int preKeyId, T_PreKey preKey) throws java.io.IOException
Store a PreKey in storage.- Parameters:
userDevice
- our OmemoDevice.preKeyId
- id of the keypreKey
- key- Throws:
java.io.IOException
- if an I/O error occurred.
-
storeOmemoPreKeys
public void storeOmemoPreKeys(OmemoDevice userDevice, java.util.TreeMap<java.lang.Integer,T_PreKey> preKeyHashMap) throws java.io.IOException
Store a whole bunch of preKeys.- Parameters:
userDevice
- our OmemoDevice.preKeyHashMap
- HashMap of preKeys- Throws:
java.io.IOException
- if an I/O error occurred.
-
removeOmemoPreKey
public abstract void removeOmemoPreKey(OmemoDevice userDevice, int preKeyId)
Remove a preKey from storage. This is called, when a contact used one of our preKeys to establish a session with us.- Parameters:
userDevice
- our OmemoDevice.preKeyId
- id of the used key that will be deleted
-
loadOmemoPreKeys
public abstract java.util.TreeMap<java.lang.Integer,T_PreKey> loadOmemoPreKeys(OmemoDevice userDevice) throws java.io.IOException
Return all our current OmemoPreKeys.- Parameters:
userDevice
- our OmemoDevice.- Returns:
- Map containing our preKeys
- Throws:
java.io.IOException
- if an I/O error occurred.
-
loadOmemoSignedPreKey
public abstract T_SigPreKey loadOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId) throws java.io.IOException
Return the signedPreKey with the id 'singedPreKeyId'.- Parameters:
userDevice
- our OmemoDevice.signedPreKeyId
- id of the key- Returns:
- loaded signed preKey
- Throws:
java.io.IOException
- if an I/O error occurred.
-
loadCurrentOmemoSignedPreKeyId
public int loadCurrentOmemoSignedPreKeyId(OmemoDevice userDevice) throws java.io.IOException
- Throws:
java.io.IOException
-
loadOmemoSignedPreKeys
public abstract java.util.TreeMap<java.lang.Integer,T_SigPreKey> loadOmemoSignedPreKeys(OmemoDevice userDevice) throws java.io.IOException
Load all our signed PreKeys.- Parameters:
userDevice
- our OmemoDevice.- Returns:
- HashMap of our singedPreKeys
- Throws:
java.io.IOException
- if an I/O error occurred.
-
generateOmemoSignedPreKey
public T_SigPreKey generateOmemoSignedPreKey(T_IdKeyPair identityKeyPair, int signedPreKeyId) throws CorruptedOmemoKeyException
Generate a new signed preKey.- Parameters:
identityKeyPair
- identityKeyPair used to sign the preKeysignedPreKeyId
- id that the preKey will have- Returns:
- a fresh signedPreKey
- Throws:
CorruptedOmemoKeyException
- when something goes wrong
-
storeOmemoSignedPreKey
public abstract void storeOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId, T_SigPreKey signedPreKey) throws java.io.IOException
Store a signedPreKey in storage.- Parameters:
userDevice
- our OmemoDevice.signedPreKeyId
- id of the signedPreKeysignedPreKey
- the key itself- Throws:
java.io.IOException
- if an I/O error occurred.
-
removeOmemoSignedPreKey
public abstract void removeOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId)
Remove a signedPreKey from storage.- Parameters:
userDevice
- our OmemoDevice.signedPreKeyId
- id of the key that will be removed
-
loadRawSession
public abstract T_Sess loadRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice) throws java.io.IOException
Load the crypto-lib specific session object of the device from storage.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- device whose session we want to load- Returns:
- crypto related session
- Throws:
java.io.IOException
- if an I/O error occurred.
-
loadAllRawSessionsOf
public abstract java.util.HashMap<java.lang.Integer,T_Sess> loadAllRawSessionsOf(OmemoDevice userDevice, BareJid contact) throws java.io.IOException
Load all crypto-lib specific session objects of contact 'contact'.- Parameters:
userDevice
- our OmemoDevice.contact
- BareJid of the contact we want to get all sessions from- Returns:
- TreeMap of deviceId and sessions of the contact
- Throws:
java.io.IOException
- if an I/O error occurred.
-
storeRawSession
public abstract void storeRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice, T_Sess session) throws java.io.IOException
Store a crypto-lib specific session to storage.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- OmemoDevice whose session we want to storesession
- session- Throws:
java.io.IOException
- if an I/O error occurred.
-
removeRawSession
public abstract void removeRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice)
Remove a crypto-lib specific session from storage.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- device whose session we want to delete
-
removeAllRawSessionsOf
public abstract void removeAllRawSessionsOf(OmemoDevice userDevice, BareJid contact)
Remove all crypto-lib specific session of a contact.- Parameters:
userDevice
- our OmemoDevice.contact
- BareJid of the contact
-
containsRawSession
public abstract boolean containsRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice)
Return true, if we have a session with the device, otherwise false. Hint for Signal: Do not try 'return getSession() != null' since this will create a new session.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- device- Returns:
- true if we have session, otherwise false
-
loadCachedDeviceList
public abstract OmemoCachedDeviceList loadCachedDeviceList(OmemoDevice userDevice, BareJid contact) throws java.io.IOException
Load a list of deviceIds from contact 'contact' from the local cache.- Parameters:
userDevice
- our OmemoDevice.contact
- contact we want to get the deviceList of- Returns:
- CachedDeviceList of the contact
- Throws:
java.io.IOException
- if an I/O error occurred.
-
loadCachedDeviceList
public OmemoCachedDeviceList loadCachedDeviceList(OmemoDevice userDevice) throws java.io.IOException
Load a list of deviceIds from our own devices.- Parameters:
userDevice
- our own OMEMO device- Returns:
- the cached OMEMO device list.
- Throws:
java.io.IOException
- if an I/O error occurred.
-
storeCachedDeviceList
public abstract void storeCachedDeviceList(OmemoDevice userDevice, BareJid contact, OmemoCachedDeviceList contactsDeviceList) throws java.io.IOException
Store the DeviceList of the contact in local storage. See this as a cache.- Parameters:
userDevice
- our OmemoDevice.contact
- ContactcontactsDeviceList
- list of the contacts devices' ids.- Throws:
java.io.IOException
- if an I/O error occurred.
-
purgeOwnDeviceKeys
public abstract void purgeOwnDeviceKeys(OmemoDevice userDevice)
Delete this device's IdentityKey, PreKeys, SignedPreKeys and Sessions.- Parameters:
userDevice
- our OmemoDevice.
-
keyUtil
public abstract OmemoKeyUtil<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_ECPub,T_Bundle> keyUtil()
Return a concrete KeyUtil object that we can use as a utility to create keys etc.- Returns:
- KeyUtil object
-
getFingerprint
public OmemoFingerprint getFingerprint(OmemoDevice userDevice) throws CorruptedOmemoKeyException, java.io.IOException
Return our identityKeys fingerprint.- Parameters:
userDevice
- our OmemoDevice.- Returns:
- fingerprint of our identityKeyPair
- Throws:
CorruptedOmemoKeyException
- if the identityKey of userDevice is corrupted.java.io.IOException
- if an I/O error occurred.
-
getFingerprint
public OmemoFingerprint getFingerprint(OmemoDevice userDevice, OmemoDevice contactsDevice) throws CorruptedOmemoKeyException, NoIdentityKeyException, java.io.IOException
Return the fingerprint of the identityKey belonging to contactsDevice.- Parameters:
userDevice
- our OmemoDevice.contactsDevice
- OmemoDevice we want to have the fingerprint for.- Returns:
- fingerprint of the userDevices IdentityKey.
- Throws:
CorruptedOmemoKeyException
- if the IdentityKey is corrupted.NoIdentityKeyException
- if no IdentityKey for contactsDevice has been found locally.java.io.IOException
- if an I/O error occurred.
-
getFingerprintAndMaybeBuildSession
public OmemoFingerprint getFingerprintAndMaybeBuildSession(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice contactsDevice) throws CannotEstablishOmemoSessionException, CorruptedOmemoKeyException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException, java.io.IOException
Return the fingerprint of the given devices announced identityKey. If we have no local copy of the identityKey of the contact, build a fresh session in order to get the key.- Parameters:
managerGuard
- authenticated OmemoManagercontactsDevice
- OmemoDevice we want to get the fingerprint from- Returns:
- fingerprint of the contacts OMEMO device
- Throws:
CannotEstablishOmemoSessionException
- If we have no local copy of the identityKey of the contact and are unable to build a fresh sessionCorruptedOmemoKeyException
- If the identityKey we have of the contact is corruptedSmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.SmackException.NoResponseException
- if there was no response from the remote entity.java.io.IOException
- if an I/O error occurred.
-
-