aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppTrustMemoryStorage.h
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2022-01-15 13:55:18 +0100
committerGitHub <noreply@github.com>2022-01-15 13:55:18 +0100
commit6491c55011d8c677b776a7ba66c21031f689c2d2 (patch)
tree3ed2a7d577351e56b923de1bbc36794f5bb997e0 /src/client/QXmppTrustMemoryStorage.h
parent282bac5d1d6190381dddaf3aa2c49fd2e5711393 (diff)
downloadqxmpp-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/QXmppTrustMemoryStorage.h')
-rw-r--r--src/client/QXmppTrustMemoryStorage.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/client/QXmppTrustMemoryStorage.h b/src/client/QXmppTrustMemoryStorage.h
index 63b8a14e..08696039 100644
--- a/src/client/QXmppTrustMemoryStorage.h
+++ b/src/client/QXmppTrustMemoryStorage.h
@@ -5,39 +5,40 @@
#ifndef QXMPPTRUSTMEMORYSTORAGE_H
#define QXMPPTRUSTMEMORYSTORAGE_H
-#include "QXmppGlobal.h"
#include "QXmppTrustStorage.h"
#include <memory>
class QXmppTrustMemoryStoragePrivate;
-class QXMPP_EXPORT QXmppTrustMemoryStorage : public QXmppTrustStorage
+class QXMPP_EXPORT QXmppTrustMemoryStorage : virtual public QXmppTrustStorage
{
public:
QXmppTrustMemoryStorage();
~QXmppTrustMemoryStorage();
/// \cond
- QFuture<void> setSecurityPolicies(const QString &encryption = {}, SecurityPolicy securityPolicy = QXmppTrustStorage::NoSecurityPolicy) override;
+ QFuture<void> setSecurityPolicy(const QString &encryption, SecurityPolicy securityPolicy) override;
+ QFuture<void> resetSecurityPolicy(const QString &encryption) override;
QFuture<SecurityPolicy> securityPolicy(const QString &encryption) override;
- QFuture<void> addOwnKey(const QString &encryption, const QByteArray &keyId) override;
- QFuture<void> removeOwnKey(const QString &encryption) override;
+ QFuture<void> setOwnKey(const QString &encryption, const QByteArray &keyId) override;
+ QFuture<void> resetOwnKey(const QString &encryption) override;
QFuture<QByteArray> ownKey(const QString &encryption) override;
QFuture<void> addKeys(const QString &encryption, const QString &keyOwnerJid, const QList<QByteArray> &keyIds, TrustLevel trustLevel = TrustLevel::AutomaticallyDistrusted) override;
- QFuture<void> removeKeys(const QString &encryption = {}, const QList<QByteArray> &keyIds = {}) override;
+ QFuture<void> removeKeys(const QString &encryption, const QList<QByteArray> &keyIds) override;
+ QFuture<void> removeKeys(const QString &encryption, const QString &keyOwnerJid) override;
+ QFuture<void> removeKeys(const QString &encryption) override;
QFuture<QHash<TrustLevel, QMultiHash<QString, QByteArray>>> keys(const QString &encryption, TrustLevels trustLevels = {}) override;
+ QFuture<QHash<QString, QHash<QByteArray, TrustLevel>>> keys(const QString &encryption, const QList<QString> &keyOwnerJids, TrustLevels trustLevels = {}) override;
+ QFuture<bool> hasKey(const QString &encryption, const QString &keyOwnerJid, TrustLevels trustLevels) override;
QFuture<void> setTrustLevel(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds, const TrustLevel trustLevel) override;
QFuture<void> setTrustLevel(const QString &encryption, const QList<QString> &keyOwnerJids, const TrustLevel oldTrustLevel, const TrustLevel newTrustLevel) override;
QFuture<TrustLevel> trustLevel(const QString &encryption, const QByteArray &keyId) override;
- 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<QHash<bool, QMultiHash<QString, QByteArray>>> keysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds = {}) override;
+ QFuture<void> resetAll(const QString &encryption) override;
/// \endcond
private: