diff options
| author | Melvin Keskin <melvo@olomono.de> | 2022-01-15 13:55:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-15 13:55:18 +0100 |
| commit | 6491c55011d8c677b776a7ba66c21031f689c2d2 (patch) | |
| tree | 3ed2a7d577351e56b923de1bbc36794f5bb997e0 /src/client/QXmppAtmTrustMemoryStorage.h | |
| parent | 282bac5d1d6190381dddaf3aa2c49fd2e5711393 (diff) | |
| download | qxmpp-6491c55011d8c677b776a7ba66c21031f689c2d2.tar.gz | |
Split up ATM parts of trust storage and refactor (#388)
QXmppTrustStorage is now the base class for all trust storages used by
end-to-end encryption managers.
QXmppAtmTrustStorage is used by QXmppAtmManager.
QXmppTrustMemoryStorage is now the base class for all trust storages
that use the memory for storing data.
QXmppAtmTrustMemoryStorage can be used by QXmppAtmManager.
Methods needed by the upcoming OMEMO implementation are added.
Some existing methods are refactored.
Diffstat (limited to 'src/client/QXmppAtmTrustMemoryStorage.h')
| -rw-r--r-- | src/client/QXmppAtmTrustMemoryStorage.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/client/QXmppAtmTrustMemoryStorage.h b/src/client/QXmppAtmTrustMemoryStorage.h new file mode 100644 index 00000000..432c2058 --- /dev/null +++ b/src/client/QXmppAtmTrustMemoryStorage.h @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2022 Melvin Keskin <melvo@olomono.de> +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef QXMPPATMTRUSTMEMORYSTORAGE_H +#define QXMPPATMTRUSTMEMORYSTORAGE_H + +#include "QXmppAtmTrustStorage.h" +#include "QXmppTrustMemoryStorage.h" + +class QXmppAtmTrustMemoryStoragePrivate; + +class QXMPP_EXPORT QXmppAtmTrustMemoryStorage : virtual public QXmppAtmTrustStorage, public QXmppTrustMemoryStorage +{ +public: + QXmppAtmTrustMemoryStorage(); + ~QXmppAtmTrustMemoryStorage(); + + /// \cond + QFuture<void> addKeysForPostponedTrustDecisions(const QString &encryption, const QByteArray &senderKeyId, const QList<QXmppTrustMessageKeyOwner> &keyOwners) override; + QFuture<void> removeKeysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &keyIdsForAuthentication, const QList<QByteArray> &keyIdsForDistrusting) override; + QFuture<void> removeKeysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds) override; + QFuture<void> removeKeysForPostponedTrustDecisions(const QString &encryption) override; + QFuture<QHash<bool, QMultiHash<QString, QByteArray>>> keysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds = {}) override; + + QFuture<void> resetAll(const QString &encryption) override; + /// \endcond + +private: + std::unique_ptr<QXmppAtmTrustMemoryStoragePrivate> d; +}; + +#endif // QXMPPATMTRUSTMEMORYSTORAGE_H |
