Loading...
Searching...
No Matches
QXmppTrustManager.h
// SPDX-FileCopyrightText: 2022 Melvin Keskin <melvo@olomono.de>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPTRUSTMANAGER_H
#define QXMPPTRUSTMANAGER_H
#include "QXmppClientExtension.h"
#include "QXmppTrustLevel.h"
#include "QXmppTrustSecurityPolicy.h"
template<typename T>
class QXmppTask;
class QXmppTrustStorage;
class QXMPP_EXPORT QXmppTrustManager : public QXmppClientExtension
{
Q_OBJECT
public:
QXmppTrustManager(QXmppTrustStorage *trustStorage);
~QXmppTrustManager();
QXmppTask<void> setSecurityPolicy(const QString &encryption, QXmpp::TrustSecurityPolicy securityPolicy);
QXmppTask<void> resetSecurityPolicy(const QString &encryption);
QXmppTask<QXmpp::TrustSecurityPolicy> securityPolicy(const QString &encryption);
QXmppTask<void> setOwnKey(const QString &encryption, const QByteArray &keyId);
QXmppTask<void> resetOwnKey(const QString &encryption);
QXmppTask<QByteArray> ownKey(const QString &encryption);
QXmppTask<void> addKeys(const QString &encryption, const QString &keyOwnerJid, const QList<QByteArray> &keyIds, QXmpp::TrustLevel trustLevel = QXmpp::TrustLevel::AutomaticallyDistrusted);
QXmppTask<void> removeKeys(const QString &encryption, const QList<QByteArray> &keyIds);
QXmppTask<void> removeKeys(const QString &encryption, const QString &keyOwnerJid);
QXmppTask<void> removeKeys(const QString &encryption);
QXmppTask<QHash<QXmpp::TrustLevel, QMultiHash<QString, QByteArray>>> keys(const QString &encryption, QXmpp::TrustLevels trustLevels = {});
QXmppTask<QHash<QString, QHash<QByteArray, QXmpp::TrustLevel>>> keys(const QString &encryption, const QList<QString> &keyOwnerJids, QXmpp::TrustLevels trustLevels = {});
QXmppTask<bool> hasKey(const QString &encryption, const QString &keyOwnerJid, QXmpp::TrustLevels trustLevels);
QXmppTask<void> setTrustLevel(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds, QXmpp::TrustLevel trustLevel);
QXmppTask<void> setTrustLevel(const QString &encryption, const QList<QString> &keyOwnerJids, QXmpp::TrustLevel oldTrustLevel, QXmpp::TrustLevel newTrustLevel);
QXmppTask<QXmpp::TrustLevel> trustLevel(const QString &encryption, const QString &keyOwnerJid, const QByteArray &keyId);
QXmppTask<void> resetAll(const QString &encryption);
Q_SIGNAL void trustLevelsChanged(const QHash<QString, QMultiHash<QString, QByteArray>> &modifiedKeys);
protected:
inline QXmppTrustStorage *trustStorage() const
{
return m_trustStorage;
}
private:
QXmppTrustStorage *m_trustStorage;
};
#endif // QXMPPTRUSTMANAGER_H
QXmppClientExtension
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:32
QXmppTask
Definition QXmppTask.h:62
QXmppTrustManager
The QXmppTrustManager manages end-to-end encryption trust decisions.
Definition QXmppTrustManager.h:18
QXmppTrustManager::trustLevelsChanged
Q_SIGNAL void trustLevelsChanged(const QHash< QString, QMultiHash< QString, QByteArray > > &modifiedKeys)
QXmppTrustStorage
The QXmppTrustStorage class stores end-to-end encryption trust data.
Definition QXmppTrustStorage.h:16
QXmpp::TrustLevel
TrustLevel
Definition QXmppTrustLevel.h:19
QXmpp::TrustLevel::AutomaticallyDistrusted
@ AutomaticallyDistrusted
QXmpp::TrustSecurityPolicy
TrustSecurityPolicy
Definition QXmppTrustSecurityPolicy.h:18