Loading...
Searching...
No Matches
QXmppAtmManager Class Reference
Managers

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

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

## Public Member Functions

| QXmppAtmManager (QXmppAtmTrustStorage *trustStorage)
QXmppTask< void > | makeTrustDecisions (const QString &encryption, const QString &keyOwnerJid, const QList< QByteArray > &keyIdsForAuthentication, const 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::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)
Public Member Functions inherited from QXmppClientExtension
| QXmppClientExtension ()
virtual QStringList | discoveryFeatures () const
virtual QList< QXmppDiscoveryIq::Identity > | discoveryIdentities () 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)

## Protected Member Functions

QXmppTask< void > | makeTrustDecisions (const QString &encryption, const QMultiHash< QString, QByteArray > &keyIdsForAuthentication, const QMultiHash< QString, QByteArray > &keyIdsForDistrusting)
QXmppTask< void > | handleMessage (const QXmppMessage &message)
QXmppTask< void > | authenticate (const QString &encryption, const QMultiHash< QString, QByteArray > &keyIds)
QXmppTask< void > | distrust (const QString &encryption, const QMultiHash< QString, QByteArray > &keyIds)
QXmppTask< void > | distrustAutomaticallyTrustedKeys (const QString &encryption, const QList< QString > &keyOwnerJids)
QXmppTask< void > | makePostponedTrustDecisions (const QString &encryption, const QList< QByteArray > &senderKeyIds)
QXmppTask< QXmpp::SendResult > | sendTrustMessage (const QString &encryption, const QList< QXmppTrustMessageKeyOwner > &keyOwners, const QString &recipientJid)
Protected Member Functions inherited from QXmppClientExtension
QXmppClient * | client () 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)
void | info (const QString &message)
void | warning (const QString &message)
void | logReceived (const QString &message)
void | logSent (const QString &message)

## Friends

class | tst_QXmppAtmManager

## Additional Inherited Members

Signals inherited from QXmppLoggable
void | setGauge (const QString &gauge, double value)
| Sets the given gauge to value.
void | logMessage (QXmppLogger::MessageType type, const QString &msg)
| This signal is emitted to send logging messages.
void | updateCounter (const QString &counter, qint64 amount=1)
| Updates the given counter by amount.

## 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:

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

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

QXmppCarbonManager *carbonManager = new QXmppCarbonManager;
carbonManager->setCarbonsEnabled(true);
client->addExtension(carbonManager);
QXmppCarbonManager
The QXmppCarbonManager class handles message carbons as described in XEP-0280: Message Carbons.
Definition QXmppCarbonManager.h:26
QXmppCarbonManager::setCarbonsEnabled
void setCarbonsEnabled(bool enabled)
Definition QXmppCarbonManager.cpp:46

and XEP-0313: Message Archive Management with

QXmppMamManager *mamManager = new QXmppMamManager;
client->addExtension(mamManager);
QXmppMamManager
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.

Warning
  THIS API IS NOT FINALIZED YET!

Since
  QXmpp 1.5

## Constructor & Destructor Documentation

## QXmppAtmManager()

QXmppAtmManager::QXmppAtmManager | ( | QXmppAtmTrustStorage * | trustStorage | ) |

Constructs an ATM manager.

Parameters

  trustStorage | trust storage implementation

## Member Function Documentation

## authenticate()

QXmppTask< void > QXmppAtmManager::authenticate | ( | const QString & | encryption,
|  | const QMultiHash< QString, QByteArray > & | keyIds
| ) |  |

protected

Authenticates keys automatically by the content of a trust message.

Parameters

  encryption | encryption protocol namespace
  keyIds | key owners' bare JIDs mapped to the IDs of their keys

## distrust()

QXmppTask< void > QXmppAtmManager::distrust | ( | const QString & | encryption,
|  | const QMultiHash< QString, QByteArray > & | keyIds
| ) |  |

protected

Distrusts keys automatically by the content of a trust message.

Parameters

  encryption | encryption protocol namespace
  keyIds | key owners' bare JIDs mapped to the IDs of their keys

## distrustAutomaticallyTrustedKeys()

QXmppTask< void > QXmppAtmManager::distrustAutomaticallyTrustedKeys | ( | const QString & | encryption,
|  | const QList< QString > & | keyOwnerJids
| ) |  |

protected

Distrusts all formerly automatically trusted keys (as specifed by the security policy TOAKAFA).

Parameters

  encryption | encryption protocol namespace
  keyOwnerJids | bare JIDs of the key owners

## handleMessage()

QXmppTask< void > QXmppAtmManager::handleMessage | ( | const QXmppMessage & | message | ) |

protected

Handles incoming messages and uses included trust message elements for making automatic trust decisions.

Parameters

  message | message that can contain a trust message element

## makePostponedTrustDecisions()

QXmppTask< void > QXmppAtmManager::makePostponedTrustDecisions | ( | const QString & | encryption,
|  | const QList< QByteArray > & | senderKeyIds
| ) |  |

protected

Authenticates or distrusts keys for whom earlier trust messages were received but not used for authenticating or distrusting at that time.

As soon as the senders' keys have been authenticated, all postponed trust decisions can be performed by this method.

Parameters

  encryption | encryption protocol namespace
  senderKeyIds | IDs of the keys that were used by the senders

## makeTrustDecisions() [1/2]

QXmppTask< void > QXmppAtmManager::makeTrustDecisions | ( | const QString & | encryption,
|  | const QMultiHash< QString, QByteArray > & | keyIdsForAuthentication,
|  | const QMultiHash< QString, QByteArray > & | keyIdsForDistrusting
| ) |  |

protected

Authenticates or distrusts keys.

Parameters

  encryption | encryption protocol namespace
  keyIdsForAuthentication | key owners' bare JIDs mapped to the IDs of their keys being authenticated
  keyIdsForDistrusting | key owners' bare JIDs mapped to the IDs of their keys being distrusted

## makeTrustDecisions() [2/2]

QXmppTask< void > QXmppAtmManager::makeTrustDecisions | ( | const QString & | encryption,
|  | const QString & | keyOwnerJid,
|  | const QList< QByteArray > & | keyIdsForAuthentication,
|  | const 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

  encryption | encryption protocol namespace
  keyOwnerJid | JID of the key owner
  keyIdsForAuthentication | IDs of the keys being authenticated
  keyIdsForDistrusting | IDs of the keys being distrusted

## sendTrustMessage()

QXmppTask< QXmpp::SendResult > QXmppAtmManager::sendTrustMessage | ( | const QString & | encryption,
|  | const QList< QXmppTrustMessageKeyOwner > & | keyOwners,
|  | const QString & | recipientJid
| ) |  |

protected

Sends a trust message.

Parameters

  encryption | namespace of the encryption
  keyOwners | key owners containing the data for authentication or distrusting
  recipientJid | JID of the recipient

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

- QXmppAtmManager.h
- QXmppAtmManager.cpp