Class SignalOmemoService

java.lang.Object
org.jivesoftware.smackx.omemo.OmemoService<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>
org.jivesoftware.smackx.omemo.signal.SignalOmemoService
All Implemented Interfaces:
OmemoCarbonCopyStanzaReceivedListener, OmemoMessageStanzaReceivedListener

public final class SignalOmemoService extends OmemoService<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>
Concrete implementation of the OmemoService using the Signal library.
  • Method Details

    • instantiateOmemoRatchet

      protected SignalOmemoRatchet instantiateOmemoRatchet(OmemoManager manager, 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)
      Description copied from class: OmemoService
      Return a new instance of the OMEMO ratchet. The ratchet is internally used to encrypt/decrypt message keys.
      Specified by:
      instantiateOmemoRatchet in class OmemoService<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>
      Parameters:
      manager - OmemoManager
      store - OmemoStore
      Returns:
      instance of the OmemoRatchet
    • setup

      public static void setup()
    • createDefaultOmemoStoreBackend

      public 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> createDefaultOmemoStoreBackend()
      Description copied from class: OmemoService
      Create a default OmemoStore object.
      Specified by:
      createDefaultOmemoStoreBackend in class OmemoService<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>
      Returns:
      default omemoStore.
    • acknowledgeLicense

      public static void acknowledgeLicense()
    • processBundle

      protected void processBundle(OmemoManager omemoManager, org.whispersystems.libsignal.state.PreKeyBundle contactsBundle, OmemoDevice contactsDevice) throws CorruptedOmemoKeyException
      Description copied from class: OmemoService
      Process a received bundle. Typically, that includes saving keys and building a session.
      Specified by:
      processBundle in class OmemoService<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>
      Parameters:
      omemoManager - our OmemoManager
      contactsBundle - bundle of the contact
      contactsDevice - OmemoDevice of the contact
      Throws:
      CorruptedOmemoKeyException - if the OMEMO key is corrupted.