Class SignalOmemoStoreConnector
- java.lang.Object
-
- org.jivesoftware.smackx.omemo.signal.SignalOmemoStoreConnector
-
- All Implemented Interfaces:
org.whispersystems.libsignal.state.IdentityKeyStore
,org.whispersystems.libsignal.state.PreKeyStore
,org.whispersystems.libsignal.state.SessionStore
,org.whispersystems.libsignal.state.SignedPreKeyStore
public class SignalOmemoStoreConnector extends Object implements org.whispersystems.libsignal.state.IdentityKeyStore, org.whispersystems.libsignal.state.SessionStore, org.whispersystems.libsignal.state.PreKeyStore, org.whispersystems.libsignal.state.SignedPreKeyStore
Class that adapts libsignal-protocol-java's Store classes to the OmemoStore class.
-
-
Constructor Summary
Constructors Constructor Description SignalOmemoStoreConnector(OmemoManager omemoManager, OmemoStore<org.whispersystems.libsignal.IdentityKeyPair,org.whispersystems.libsignal.IdentityKey,org.whispersystems.libsignal.state.PreKeyRecord,org.whispersystems.libsignal.state.SignedPreKeyRecord,org.whispersystems.libsignal.state.SessionRecord,org.whispersystems.libsignal.SignalProtocolAddress,org.whispersystems.libsignal.ecc.ECPublicKey,org.whispersystems.libsignal.state.PreKeyBundle,org.whispersystems.libsignal.SessionCipher> store)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.whispersystems.libsignal.SignalProtocolAddress
asAddress(OmemoDevice device)
boolean
containsPreKey(int i)
boolean
containsSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
boolean
containsSignedPreKey(int i)
void
deleteAllSessions(String s)
void
deleteSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
org.whispersystems.libsignal.IdentityKeyPair
getIdentityKeyPair()
int
getLocalRegistrationId()
The OMEMO protocol does not make use of a local registration ID, so we can simply return 0 here.List<Integer>
getSubDeviceSessions(String s)
boolean
isTrustedIdentity(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.IdentityKey identityKey, org.whispersystems.libsignal.state.IdentityKeyStore.Direction direction)
org.whispersystems.libsignal.state.PreKeyRecord
loadPreKey(int i)
org.whispersystems.libsignal.state.SessionRecord
loadSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
org.whispersystems.libsignal.state.SignedPreKeyRecord
loadSignedPreKey(int i)
List<org.whispersystems.libsignal.state.SignedPreKeyRecord>
loadSignedPreKeys()
void
removePreKey(int i)
void
removeSignedPreKey(int i)
boolean
saveIdentity(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.IdentityKey identityKey)
void
storePreKey(int i, org.whispersystems.libsignal.state.PreKeyRecord preKeyRecord)
void
storeSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.state.SessionRecord sessionRecord)
void
storeSignedPreKey(int i, org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyRecord)
-
-
-
Constructor Detail
-
SignalOmemoStoreConnector
public SignalOmemoStoreConnector(OmemoManager omemoManager, OmemoStore<org.whispersystems.libsignal.IdentityKeyPair,org.whispersystems.libsignal.IdentityKey,org.whispersystems.libsignal.state.PreKeyRecord,org.whispersystems.libsignal.state.SignedPreKeyRecord,org.whispersystems.libsignal.state.SessionRecord,org.whispersystems.libsignal.SignalProtocolAddress,org.whispersystems.libsignal.ecc.ECPublicKey,org.whispersystems.libsignal.state.PreKeyBundle,org.whispersystems.libsignal.SessionCipher> store)
-
-
Method Detail
-
getIdentityKeyPair
public org.whispersystems.libsignal.IdentityKeyPair getIdentityKeyPair()
- Specified by:
getIdentityKeyPair
in interfaceorg.whispersystems.libsignal.state.IdentityKeyStore
-
getLocalRegistrationId
public int getLocalRegistrationId()
The OMEMO protocol does not make use of a local registration ID, so we can simply return 0 here.- Specified by:
getLocalRegistrationId
in interfaceorg.whispersystems.libsignal.state.IdentityKeyStore
- Returns:
- local registration id.
-
saveIdentity
public boolean saveIdentity(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.IdentityKey identityKey)
- Specified by:
saveIdentity
in interfaceorg.whispersystems.libsignal.state.IdentityKeyStore
-
isTrustedIdentity
public boolean isTrustedIdentity(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.IdentityKey identityKey, org.whispersystems.libsignal.state.IdentityKeyStore.Direction direction)
- Specified by:
isTrustedIdentity
in interfaceorg.whispersystems.libsignal.state.IdentityKeyStore
-
loadPreKey
public org.whispersystems.libsignal.state.PreKeyRecord loadPreKey(int i) throws org.whispersystems.libsignal.InvalidKeyIdException
- Specified by:
loadPreKey
in interfaceorg.whispersystems.libsignal.state.PreKeyStore
- Throws:
org.whispersystems.libsignal.InvalidKeyIdException
-
storePreKey
public void storePreKey(int i, org.whispersystems.libsignal.state.PreKeyRecord preKeyRecord)
- Specified by:
storePreKey
in interfaceorg.whispersystems.libsignal.state.PreKeyStore
-
containsPreKey
public boolean containsPreKey(int i)
- Specified by:
containsPreKey
in interfaceorg.whispersystems.libsignal.state.PreKeyStore
-
removePreKey
public void removePreKey(int i)
- Specified by:
removePreKey
in interfaceorg.whispersystems.libsignal.state.PreKeyStore
-
loadSession
public org.whispersystems.libsignal.state.SessionRecord loadSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
- Specified by:
loadSession
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
getSubDeviceSessions
public List<Integer> getSubDeviceSessions(String s)
- Specified by:
getSubDeviceSessions
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
storeSession
public void storeSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.state.SessionRecord sessionRecord)
- Specified by:
storeSession
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
containsSession
public boolean containsSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
- Specified by:
containsSession
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
deleteSession
public void deleteSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
- Specified by:
deleteSession
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
deleteAllSessions
public void deleteAllSessions(String s)
- Specified by:
deleteAllSessions
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
loadSignedPreKey
public org.whispersystems.libsignal.state.SignedPreKeyRecord loadSignedPreKey(int i) throws org.whispersystems.libsignal.InvalidKeyIdException
- Specified by:
loadSignedPreKey
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
- Throws:
org.whispersystems.libsignal.InvalidKeyIdException
-
loadSignedPreKeys
public List<org.whispersystems.libsignal.state.SignedPreKeyRecord> loadSignedPreKeys()
- Specified by:
loadSignedPreKeys
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
-
storeSignedPreKey
public void storeSignedPreKey(int i, org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyRecord)
- Specified by:
storeSignedPreKey
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
-
containsSignedPreKey
public boolean containsSignedPreKey(int i)
- Specified by:
containsSignedPreKey
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
-
removeSignedPreKey
public void removeSignedPreKey(int i)
- Specified by:
removeSignedPreKey
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
-
asAddress
public static org.whispersystems.libsignal.SignalProtocolAddress asAddress(OmemoDevice device)
-
-