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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.whispersystems.libsignal.state.IdentityKeyStore
org.whispersystems.libsignal.state.IdentityKeyStore.Direction
-
Constructor Summary
ConstructorDescriptionSignalOmemoStoreConnector
(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
Modifier and TypeMethodDescriptionstatic org.whispersystems.libsignal.SignalProtocolAddress
asAddress
(OmemoDevice device) boolean
containsPreKey
(int i) boolean
containsSession
(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress) boolean
containsSignedPreKey
(int i) void
void
deleteSession
(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress) org.whispersystems.libsignal.IdentityKey
getIdentity
(org.whispersystems.libsignal.SignalProtocolAddress address) org.whispersystems.libsignal.IdentityKeyPair
int
The OMEMO protocol does not make use of a local registration ID, so we can simply return 0 here.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>
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 Details
-
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 Details
-
getIdentityKeyPair
- Specified by:
getIdentityKeyPair
in interfaceorg.whispersystems.libsignal.state.IdentityKeyStore
-
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
-
getIdentity
public org.whispersystems.libsignal.IdentityKey getIdentity(org.whispersystems.libsignal.SignalProtocolAddress address) - Specified by:
getIdentity
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
- Specified by:
storePreKey
in interfaceorg.whispersystems.libsignal.state.PreKeyStore
-
containsPreKey
- Specified by:
containsPreKey
in interfaceorg.whispersystems.libsignal.state.PreKeyStore
-
removePreKey
- 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
- 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
- Specified by:
deleteSession
in interfaceorg.whispersystems.libsignal.state.SessionStore
-
deleteAllSessions
- 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
- 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
- Specified by:
containsSignedPreKey
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
-
removeSignedPreKey
- Specified by:
removeSignedPreKey
in interfaceorg.whispersystems.libsignal.state.SignedPreKeyStore
-
asAddress
-