SignalOmemoStore.java

  1. /**
  2.  *
  3.  * Copyright 2017 Paul Schaub
  4.  *
  5.  * This file is part of smack-omemo-signal.
  6.  *
  7.  * smack-omemo-signal is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 3 of the License, or
  10.  * (at your option) any later version.
  11.  *
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software Foundation,
  19.  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  20.  */
  21. package org.jivesoftware.smackx.omemo.signal;

  22. import org.jivesoftware.smackx.omemo.OmemoStore;
  23. import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil;

  24. import org.whispersystems.libsignal.IdentityKey;
  25. import org.whispersystems.libsignal.IdentityKeyPair;
  26. import org.whispersystems.libsignal.SessionCipher;
  27. import org.whispersystems.libsignal.SignalProtocolAddress;
  28. import org.whispersystems.libsignal.ecc.ECPublicKey;
  29. import org.whispersystems.libsignal.state.PreKeyBundle;
  30. import org.whispersystems.libsignal.state.PreKeyRecord;
  31. import org.whispersystems.libsignal.state.SessionRecord;
  32. import org.whispersystems.libsignal.state.SignedPreKeyRecord;

  33. /**
  34.  * Implementation of the OmemoStore using the Signal library.
  35.  *
  36.  * @author Paul Schaub
  37.  */
  38. @SuppressWarnings("unused")
  39. public abstract class SignalOmemoStore
  40.         extends OmemoStore<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord,
  41.         SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> {

  42.     private final SignalOmemoKeyUtil signalKeyUtil = new SignalOmemoKeyUtil();

  43.     @Override
  44.     public OmemoKeyUtil<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord, ECPublicKey, PreKeyBundle> keyUtil() {
  45.         return signalKeyUtil;
  46.     }
  47. }