QXmpp: QXmppAtmManager.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppAtmManager.h
1// SPDX-FileCopyrightText: 2021 Melvin Keskin <melvo@olomono.de>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPATMMANAGER_H
6#define QXMPPATMMANAGER_H
7
8#include "QXmppAtmTrustStorage.h"
9#include "QXmppSendResult.h"
10#include "QXmppTrustManager.h"
11
12class QXmppMessage;
13class QXmppTrustMessageKeyOwner;
14template<typename T>
15class QXmppTask;
16
17 class QXMPP_EXPORT QXmppAtmManager : public QXmppTrustManager
18{
19 Q_OBJECT
20
21public:
22 QXmppAtmManager(QXmppAtmTrustStorage *trustStorage);
23 QXmppTask<void> makeTrustDecisions(const QString &encryption, const QString &keyOwnerJid, const QList<QByteArray> &keyIdsForAuthentication, const QList<QByteArray> &keyIdsForDistrusting = {});
24
25protected:
27 void onRegistered(QXmppClient *client) override;
28 void onUnregistered(QXmppClient *client) override;
29
30private:
31 Q_SLOT void handleMessageReceived(const QXmppMessage &message);
33
34 QXmppTask<void> makeTrustDecisions(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIdsForAuthentication, const QMultiHash<QString, QByteArray> &keyIdsForDistrusting);
35 QXmppTask<void> handleMessage(const QXmppMessage &message);
36
37 QXmppTask<void> authenticate(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds);
38 QXmppTask<void> distrust(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds);
39
40 QXmppTask<void> distrustAutomaticallyTrustedKeys(const QString &encryption, const QList<QString> &keyOwnerJids);
41 QXmppTask<void> makePostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds);
42
43 QXmppTask<QXmpp::SendResult> sendTrustMessage(const QString &encryption, const QList<QXmppTrustMessageKeyOwner> &keyOwners, const QString &recipientJid);
44
46 inline QXmppAtmTrustStorage *trustStorage() const
47 {
48 return dynamic_cast<QXmppAtmTrustStorage *>(QXmppTrustManager::trustStorage());
49 }
51
52 friend class tst_QXmppTrustManager;
53};
54
55#endif // QXMPPATMMANAGER_H
QXmppAtmManager::makePostponedTrustDecisions
QXmppTask< void > makePostponedTrustDecisions(const QString &encryption, const QList< QByteArray > &senderKeyIds)
Definition QXmppAtmManager.cpp:456
QXmppAtmManager::makeTrustDecisions
QXmppTask< void > makeTrustDecisions(const QString &encryption, const QString &keyOwnerJid, const QList< QByteArray > &keyIdsForAuthentication, const QList< QByteArray > &keyIdsForDistrusting={})
Definition QXmppAtmManager.cpp:80
QXmppAtmManager::distrust
QXmppTask< void > distrust(const QString &encryption, const QMultiHash< QString, QByteArray > &keyIds)
Definition QXmppAtmManager.cpp:415
QXmppAtmManager::distrustAutomaticallyTrustedKeys
QXmppTask< void > distrustAutomaticallyTrustedKeys(const QString &encryption, const QList< QString > &keyOwnerJids)
Definition QXmppAtmManager.cpp:441
QXmppAtmManager::handleMessage
QXmppTask< void > handleMessage(const QXmppMessage &message)
Definition QXmppAtmManager.cpp:293
QXmppAtmManager::authenticate
QXmppTask< void > authenticate(const QString &encryption, const QMultiHash< QString, QByteArray > &keyIds)
Definition QXmppAtmManager.cpp:377
QXmppAtmManager::sendTrustMessage
QXmppTask< QXmpp::SendResult > sendTrustMessage(const QString &encryption, const QList< QXmppTrustMessageKeyOwner > &keyOwners, const QString &recipientJid)
Definition QXmppAtmManager.cpp:485
QXmppAtmTrustStorage
The QXmppAtmTrustStorage class stores trust data for XEP-0450: Automatic Trust Management (ATM).
Definition QXmppAtmTrustStorage.h:15
QXmppClientExtension::onUnregistered
virtual void onUnregistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:95
QXmppClientExtension::onRegistered
virtual void onRegistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:85
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
QXmppMessage
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:64
QXmppTask
Definition QXmppTask.h:46
QXmppTrustManager::QXmppTrustManager
QXmppTrustManager(QXmppTrustStorage *trustStorage)
Definition QXmppTrustManager.cpp:31
QXmppTrustMessageKeyOwner
The QXmppTrustMessageKeyOwner class represents a key owner of the trust message as defined by XEP-043...
Definition QXmppTrustMessageKeyOwner.h:18
QXmppAtmManager::QXmppAtmManager
QXmppAtmManager(QXmppAtmTrustStorage *trustStorage)
Definition QXmppAtmManager.cpp:65