001/**
002 *
003 * Copyright 2017 Paul Schaub
004 *
005 * This file is part of smack-omemo-signal.
006 *
007 * smack-omemo-signal is free software; you can redistribute it and/or modify
008 * it under the terms of the GNU General Public License as published by
009 * the Free Software Foundation; either version 3 of the License, or
010 * (at your option) any later version.
011 *
012 * This program is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015 * GNU General Public License for more details.
016 *
017 * You should have received a copy of the GNU General Public License
018 * along with this program; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
020 */
021package org.jivesoftware.smackx.omemo.signal;
022
023import org.jivesoftware.smackx.omemo.OmemoStore;
024import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil;
025
026import org.whispersystems.libsignal.IdentityKey;
027import org.whispersystems.libsignal.IdentityKeyPair;
028import org.whispersystems.libsignal.SessionCipher;
029import org.whispersystems.libsignal.SignalProtocolAddress;
030import org.whispersystems.libsignal.ecc.ECPublicKey;
031import org.whispersystems.libsignal.state.PreKeyBundle;
032import org.whispersystems.libsignal.state.PreKeyRecord;
033import org.whispersystems.libsignal.state.SessionRecord;
034import org.whispersystems.libsignal.state.SignedPreKeyRecord;
035
036/**
037 * Implementation of the OmemoStore using the Signal library.
038 *
039 * @author Paul Schaub
040 */
041@SuppressWarnings("unused")
042public abstract class SignalOmemoStore
043        extends OmemoStore<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord, SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> {
044
045    private final SignalOmemoKeyUtil signalKeyUtil = new SignalOmemoKeyUtil();
046
047    @Override
048    public OmemoKeyUtil<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord, SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> keyUtil() {
049        return signalKeyUtil;
050    }
051}