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

    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

    Modifier and Type
    Method
    Description
    static org.whispersystems.libsignal.SignalProtocolAddress
     
    boolean
     
    boolean
    containsSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
     
    boolean
     
    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
     
    List<org.whispersystems.libsignal.state.SignedPreKeyRecord>
     
    void
    removePreKey(int i)
     
    void
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public org.whispersystems.libsignal.IdentityKeyPair getIdentityKeyPair()
      Specified by:
      getIdentityKeyPair in interface org.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 interface org.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 interface org.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 interface org.whispersystems.libsignal.state.IdentityKeyStore
    • getIdentity

      public org.whispersystems.libsignal.IdentityKey getIdentity(org.whispersystems.libsignal.SignalProtocolAddress address)
      Specified by:
      getIdentity in interface org.whispersystems.libsignal.state.IdentityKeyStore
    • loadPreKey

      public org.whispersystems.libsignal.state.PreKeyRecord loadPreKey(int i) throws org.whispersystems.libsignal.InvalidKeyIdException
      Specified by:
      loadPreKey in interface org.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 interface org.whispersystems.libsignal.state.PreKeyStore
    • containsPreKey

      public boolean containsPreKey(int i)
      Specified by:
      containsPreKey in interface org.whispersystems.libsignal.state.PreKeyStore
    • removePreKey

      public void removePreKey(int i)
      Specified by:
      removePreKey in interface org.whispersystems.libsignal.state.PreKeyStore
    • loadSession

      public org.whispersystems.libsignal.state.SessionRecord loadSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
      Specified by:
      loadSession in interface org.whispersystems.libsignal.state.SessionStore
    • getSubDeviceSessions

      Specified by:
      getSubDeviceSessions in interface org.whispersystems.libsignal.state.SessionStore
    • storeSession

      public void storeSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress, org.whispersystems.libsignal.state.SessionRecord sessionRecord)
      Specified by:
      storeSession in interface org.whispersystems.libsignal.state.SessionStore
    • containsSession

      public boolean containsSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
      Specified by:
      containsSession in interface org.whispersystems.libsignal.state.SessionStore
    • deleteSession

      public void deleteSession(org.whispersystems.libsignal.SignalProtocolAddress signalProtocolAddress)
      Specified by:
      deleteSession in interface org.whispersystems.libsignal.state.SessionStore
    • deleteAllSessions

      public void deleteAllSessions(String s)
      Specified by:
      deleteAllSessions in interface org.whispersystems.libsignal.state.SessionStore
    • loadSignedPreKey

      public org.whispersystems.libsignal.state.SignedPreKeyRecord loadSignedPreKey(int i) throws org.whispersystems.libsignal.InvalidKeyIdException
      Specified by:
      loadSignedPreKey in interface org.whispersystems.libsignal.state.SignedPreKeyStore
      Throws:
      org.whispersystems.libsignal.InvalidKeyIdException
    • loadSignedPreKeys

      public List<org.whispersystems.libsignal.state.SignedPreKeyRecord> loadSignedPreKeys()
      Specified by:
      loadSignedPreKeys in interface org.whispersystems.libsignal.state.SignedPreKeyStore
    • storeSignedPreKey

      public void storeSignedPreKey(int i, org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKeyRecord)
      Specified by:
      storeSignedPreKey in interface org.whispersystems.libsignal.state.SignedPreKeyStore
    • containsSignedPreKey

      public boolean containsSignedPreKey(int i)
      Specified by:
      containsSignedPreKey in interface org.whispersystems.libsignal.state.SignedPreKeyStore
    • removeSignedPreKey

      public void removeSignedPreKey(int i)
      Specified by:
      removeSignedPreKey in interface org.whispersystems.libsignal.state.SignedPreKeyStore
    • asAddress

      public static org.whispersystems.libsignal.SignalProtocolAddress asAddress(OmemoDevice device)