QXmpp Version: 1.15.1
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
QXmppAtmManager Class Reference

The QXmppAtmManager class represents a manager for XEP-0450: Automatic Trust Management (ATM). More...

Inheritance diagram for QXmppAtmManager:
Inheritance graph
[legend]
Collaboration diagram for QXmppAtmManager:
Collaboration graph
[legend]

Public Member Functions

 QXmppAtmManager (QXmppAtmTrustStorage *trustStorage)
 
QXmppTask< void > makeTrustDecisions (QString encryption, QString keyOwnerJid, QList< QByteArray > keyIdsForAuthentication, QList< QByteArray > keyIdsForDistrusting={})
 
- Public Member Functions inherited from QXmppTrustManager
 QXmppTrustManager (QXmppTrustStorage *trustStorage)
 
QXmppTask< void > setSecurityPolicy (const QString &encryption, QXmpp::TrustSecurityPolicy securityPolicy)
 
QXmppTask< void > resetSecurityPolicy (const QString &encryption)
 
QXmppTask< QXmpp::TrustSecurityPolicysecurityPolicy (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::TrustLeveltrustLevel (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)
 
- Public Member Functions inherited from QXmppClientExtension
 QXmppClientExtension ()
 
virtual QStringList discoveryFeatures () const
 
virtual QList< QXmppDiscoIdentitydiscoveryIdentities () const
 
virtual bool handleStanza (const QDomElement &stanza)
 You need to implement this method to process incoming XMPP stanzas.
 
virtual bool handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
 You need to implement this method to process incoming XMPP stanzas.
 
- Public Member Functions inherited from QXmppLoggable
 QXmppLoggable (QObject *parent=nullptr)
 
Q_SIGNAL void setGauge (const QString &gauge, double value)
 Sets the given gauge to value.
 
Q_SIGNAL void logMessage (QXmppLogger::MessageType type, const QString &msg)
 This signal is emitted to send logging messages.
 
Q_SIGNAL void updateCounter (const QString &counter, qint64 amount=1)
 Updates the given counter by amount.
 

Friends

class tst_QXmppTrustManager
 

Additional Inherited Members

- Protected Member Functions inherited from QXmppClientExtension
QXmppClientclient () const
 
virtual void setClient (QXmppClient *client)
 
virtual void onRegistered (QXmppClient *client)
 
virtual void onUnregistered (QXmppClient *client)
 
void injectIq (const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
 
bool injectMessage (QXmppMessage &&message)
 
- Protected Member Functions inherited from QXmppLoggable
void debug (const QString &message)
 Logs a debugging message.
 
void info (const QString &message)
 Logs an informational message.
 
void warning (const QString &message)
 Logs a warning message.
 
void logReceived (const QString &message)
 Logs a received packet.
 
void logSent (const QString &message)
 Logs a sent packet.
 

Detailed Description

The QXmppAtmManager class represents a manager for XEP-0450: Automatic Trust Management (ATM).

For interacting with the storage, a corresponding implementation of the storage interface must be added. That implementation has to be adapted to your storage such as a database. In case you only need memory and no peristent storage, you can use the existing implementation and add the storage with it:

QXmppAtmManager *manager = new QXmppAtmManager(trustStorage);
client->addExtension(manager);
The QXmppAtmManager class represents a manager for XEP-0450: Automatic Trust Management (ATM).
Definition QXmppAtmManager.h:18
The QXmppAtmTrustMemoryStorage class stores trust data for XEP-0450: Automatic Trust Management (ATM)...
Definition QXmppAtmTrustMemoryStorage.h:14
The QXmppAtmTrustStorage class stores trust data for XEP-0450: Automatic Trust Management (ATM).
Definition QXmppAtmTrustStorage.h:15
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
bool addExtension(QXmppClientExtension *extension)
Registers a new extension with the client.
Definition QXmppClient.cpp:379

It is strongly recommended to enable XEP-0280: Message Carbons with

The QXmppCarbonManagerV2 class handles message carbons as described in XEP-0280: Message Carbons.
Definition QXmppCarbonManagerV2.h:13
T * addNewExtension(Args... args)
Definition QXmppClient.h:117

and XEP-0313: Message Archive Management with

QXmppMamManager *mamManager = new QXmppMamManager;
client->addExtension(mamManager);
The QXmppMamManager class makes it possible to access message archives as defined by XEP-0313: Messag...
Definition QXmppMamManager.h:39

for delivering trust messages to all online and offline endpoints.

In addition, archiving via MAM must be enabled on the server.

Since
QXmpp 1.5

Constructor & Destructor Documentation

◆ QXmppAtmManager()

QXmppAtmManager::QXmppAtmManager ( QXmppAtmTrustStorage trustStorage)

Constructs an ATM manager.

Parameters
trustStoragetrust storage implementation

Member Function Documentation

◆ makeTrustDecisions()

QXmppTask< void > QXmppAtmManager::makeTrustDecisions ( QString  encryption,
QString  keyOwnerJid,
QList< QByteArray >  keyIdsForAuthentication,
QList< QByteArray >  keyIdsForDistrusting = {} 
)

Authenticates or distrusts keys manually (e.g., by the Trust Message URI of a scanned QR code or after entering key IDs by hand) and sends corresponding trust messages.

Parameters
encryptionencryption protocol namespace
keyOwnerJidJID of the key owner
keyIdsForAuthenticationIDs of the keys being authenticated
keyIdsForDistrustingIDs of the keys being distrusted

The documentation for this class was generated from the following files: