From 6ecc6b6f0272a47d41ce5d619eaa779a29fcf9df Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 29 Jun 2023 14:10:06 +0200 Subject: WIP OMEMO --- trust_db.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 trust_db.h (limited to 'trust_db.h') diff --git a/trust_db.h b/trust_db.h new file mode 100644 index 0000000..d5d070a --- /dev/null +++ b/trust_db.h @@ -0,0 +1,70 @@ +#ifndef TRUST_DB_H +#define TRUST_DB_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class TrustDb : virtual public QXmppTrustStorage +{ +public: + TrustDb(const QString &jid); + + QXmppTask setSecurityPolicy(const QString &encryption, + QXmpp::TrustSecurityPolicy securityPolicy) override; + QXmppTask resetSecurityPolicy(const QString &encryption) override; + QXmppTask securityPolicy( + const QString &encryption) override; + + QXmppTask setOwnKey(const QString &encryption, + const QByteArray &keyId) override; + QXmppTask resetOwnKey(const QString &encryption) override; + QXmppTask ownKey(const QString &encryption) override; + + QXmppTask addKeys(const QString &encryption, + const QString &keyOwnerJid, const QList &keyIds, + QXmpp::TrustLevel trustLevel + = QXmpp::TrustLevel::AutomaticallyDistrusted) override; + QXmppTask removeKeys(const QString &encryption, + const QList &keyIds) override; + QXmppTask removeKeys(const QString &encryption, + const QString &keyOwnerJid) override; + QXmppTask removeKeys(const QString &encryption) override; + QXmppTask>> keys(const QString &encryption, + QXmpp::TrustLevels trustLevels = {}) override; + QXmppTask>> keys(const QString &encryption, + const QList &keyOwnerJids, + QXmpp::TrustLevels trustLevels = {}) override; + QXmppTask hasKey(const QString &encryption, + const QString &keyOwnerJid, QXmpp::TrustLevels trustLevels) override; + + QXmppTask>> setTrustLevel( + const QString &encryption, + const QMultiHash &keyIds, + QXmpp::TrustLevel trustLevel) override; + QXmppTask>> setTrustLevel( + const QString &encryption, + const QList &keyOwnerJids, + QXmpp::TrustLevel oldTrustLevel, + QXmpp::TrustLevel newTrustLevel) override; + QXmppTask trustLevel(const QString &encryption, + const QString &keyOwnerJid, const QByteArray &keyId) override; + + QXmppTask resetAll(const QString &encryption) override; + +private: + const QString &jid; + QString service() const; +}; + +#endif -- cgit v1.2.3