QXmpp  Version: 1.6.0
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 
12 class QXmppMessage;
14 template<typename T>
15 class QXmppTask;
16 
17 class QXMPP_EXPORT QXmppAtmManager : public QXmppTrustManager
18 {
19  Q_OBJECT
20 
21 public:
23  QXmppTask<void> makeTrustDecisions(const QString &encryption, const QString &keyOwnerJid, const QList<QByteArray> &keyIdsForAuthentication, const QList<QByteArray> &keyIdsForDistrusting = {});
24 
25 protected:
27  void setClient(QXmppClient *client) override;
28 
29 private:
30  Q_SLOT void handleMessageReceived(const QXmppMessage &message);
32 
33  QXmppTask<void> makeTrustDecisions(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIdsForAuthentication, const QMultiHash<QString, QByteArray> &keyIdsForDistrusting);
34  QXmppTask<void> handleMessage(const QXmppMessage &message);
35 
36  QXmppTask<void> authenticate(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds);
37  QXmppTask<void> distrust(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds);
38 
39  QXmppTask<void> distrustAutomaticallyTrustedKeys(const QString &encryption, const QList<QString> &keyOwnerJids);
40  QXmppTask<void> makePostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds);
41 
42  QXmppTask<QXmpp::SendResult> sendTrustMessage(const QString &encryption, const QList<QXmppTrustMessageKeyOwner> &keyOwners, const QString &recipientJid);
43 
45  inline QXmppAtmTrustStorage *trustStorage() const
46  {
47  return dynamic_cast<QXmppAtmTrustStorage *>(QXmppTrustManager::trustStorage());
48  }
50 
51  friend class tst_QXmppAtmManager;
52 };
53 
54 #endif // QXMPPATMMANAGER_H
The QXmppTrustMessageKeyOwner class represents a key owner of the trust message as defined by XEP-043...
Definition: QXmppTrustMessageKeyOwner.h:16
The QXmppAtmManager class represents a manager for XEP-0450: Automatic Trust Management (ATM)...
Definition: QXmppAtmManager.h:17
Definition: QXmppStream.h:20
The QXmppTrustManager manages end-to-end encryption trust decisions.
Definition: QXmppTrustManager.h:17
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:37
The QXmppAtmTrustStorage class stores trust data for XEP-0450: Automatic Trust Management (ATM)...
Definition: QXmppAtmTrustStorage.h:14
virtual void setClient(QXmppClient *client)
Definition: QXmppClientExtension.cpp:88
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:83