SignalFileBasedOmemoStore.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 java.io.File;

  23. import org.jivesoftware.smackx.omemo.FileBasedOmemoStore;
  24. import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil;

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

  34. /**
  35.  * Implementation of a FileBasedOmemoStore for the smack-omemo-signal module.
  36.  *
  37.  * @author Paul Schaub
  38.  */
  39. @SuppressWarnings("unused")
  40. public class SignalFileBasedOmemoStore
  41.         extends FileBasedOmemoStore<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord,
  42.         SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> {

  43.     public SignalFileBasedOmemoStore(File base) {
  44.         super(base);
  45.     }

  46.     @Override
  47.     public OmemoKeyUtil<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord, ECPublicKey, PreKeyBundle> keyUtil() {
  48.         return new SignalOmemoKeyUtil();
  49.     }
  50. }