QXmppTrustManager Class
The QXmppTrustManager manages end-to-end encryption trust decisions. More...
| Header: | #include <QXmppTrustManager> |
| Since: | QXmpp 1.5 |
| Inherits: | QXmppClientExtension |
| Inherited By: |
- List of all members, including inherited members
- QXmppTrustManager is part of Managers.
Public Functions
| QXmppTrustManager(QXmppTrustStorage *trustStorage) | |
| QXmppTask<void> | addKeys(const QString &encryption, const QString &keyOwnerJid, const QList<QByteArray> &keyIds, QXmpp::TrustLevel trustLevel = QXmpp::TrustLevel::AutomaticallyDistrusted) |
| QXmppTask<bool> | hasKey(const QString &encryption, const QString &keyOwnerJid, QXmpp::TrustLevels trustLevels) |
| 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<QByteArray> | ownKey(const QString &encryption) |
| QXmppTask<void> | removeKeys(const QString &encryption) |
| QXmppTask<void> | removeKeys(const QString &encryption, const QList<QByteArray> &keyIds) |
| QXmppTask<void> | removeKeys(const QString &encryption, const QString &keyOwnerJid) |
| QXmppTask<void> | resetAll(const QString &encryption) |
| QXmppTask<void> | resetOwnKey(const QString &encryption) |
| QXmppTask<void> | resetSecurityPolicy(const QString &encryption) |
| QXmppTask<QXmpp::TrustSecurityPolicy> | securityPolicy(const QString &encryption) |
| QXmppTask<void> | setOwnKey(const QString &encryption, const QByteArray &keyId) |
| QXmppTask<void> | setSecurityPolicy(const QString &encryption, QXmpp::TrustSecurityPolicy securityPolicy) |
| 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) |
Signals
| void | trustLevelsChanged(const QHash<QString, QMultiHash<QString, QByteArray>> &modifiedKeys) |
Detailed Description
Member Function Documentation
QXmppTrustManager::QXmppTrustManager(QXmppTrustStorage *trustStorage)
Constructs a trust manager using the trust storage implementation trustStorage.
QXmppTask<void> QXmppTrustManager::addKeys(const QString &encryption, const QString &keyOwnerJid, const QList<QByteArray> &keyIds, QXmpp::TrustLevel trustLevel = QXmpp::TrustLevel::AutomaticallyDistrusted)
Adds keys.
encryption is the encryption protocol namespace. keyOwnerJid is the key owner's bare JID. keyIds are the IDs of the keys. trustLevel is the trust level of the keys.
QXmppTask<bool> QXmppTrustManager::hasKey(const QString &encryption, const QString &keyOwnerJid, QXmpp::TrustLevels trustLevels)
Returns whether at least one key of the key owner with bare JID keyOwnerJid and one of the possible trust levels trustLevels is stored for the encryption protocol namespace encryption.
QXmppTask<QHash<QXmpp::TrustLevel, QMultiHash<QString, QByteArray>>> QXmppTrustManager::keys(const QString &encryption, QXmpp::TrustLevels trustLevels = {})
Returns the JIDs of all key owners mapped to the IDs of their keys with the trust levels trustLevels for the encryption protocol namespace encryption.
If no trust levels are passed, all keys for encryption are returned.
QXmppTask<QHash<QString, QHash<QByteArray, QXmpp::TrustLevel>>> QXmppTrustManager::keys(const QString &encryption, const QList<QString> &keyOwnerJids, QXmpp::TrustLevels trustLevels = {})
Returns the IDs of keys mapped to their trust levels for the key owners with bare JIDs keyOwnerJids and the encryption protocol namespace encryption, restricted to the trust levels trustLevels.
If no trust levels are passed, all keys for encryption and keyOwnerJids are returned.
QXmppTask<QByteArray> QXmppTrustManager::ownKey(const QString &encryption)
Returns the ID of the own key (i.e., the key used by this client instance) for the encryption protocol namespace encryption.
See also setOwnKey().
QXmppTask<void> QXmppTrustManager::removeKeys(const QString &encryption)
Removes all keys for the encryption protocol namespace encryption.
QXmppTask<void> QXmppTrustManager::removeKeys(const QString &encryption, const QList<QByteArray> &keyIds)
Removes the keys with IDs keyIds for the encryption protocol namespace encryption.
QXmppTask<void> QXmppTrustManager::removeKeys(const QString &encryption, const QString &keyOwnerJid)
Removes all keys of the key owner with bare JID keyOwnerJid for the encryption protocol namespace encryption.
QXmppTask<void> QXmppTrustManager::resetAll(const QString &encryption)
Resets all data for the encryption protocol namespace encryption.
QXmppTask<void> QXmppTrustManager::resetOwnKey(const QString &encryption)
Resets the own key (i.e., the key used by this client instance) for the encryption protocol namespace encryption.
QXmppTask<void> QXmppTrustManager::resetSecurityPolicy(const QString &encryption)
Resets the security policy for the encryption protocol namespace encryption.
QXmppTask<QXmpp::TrustSecurityPolicy> QXmppTrustManager::securityPolicy(const QString &encryption)
Returns the security policy for the encryption protocol namespace encryption.
See also setSecurityPolicy().
QXmppTask<void> QXmppTrustManager::setOwnKey(const QString &encryption, const QByteArray &keyId)
Sets the own key (i.e., the key used by this client instance) for the encryption protocol namespace encryption to the key with ID keyId.
See also ownKey().
QXmppTask<void> QXmppTrustManager::setSecurityPolicy(const QString &encryption, QXmpp::TrustSecurityPolicy securityPolicy)
Sets the security policy securityPolicy for the encryption protocol namespace encryption.
See also securityPolicy().
QXmppTask<void> QXmppTrustManager::setTrustLevel(const QString &encryption, const QMultiHash<QString, QByteArray> &keyIds, QXmpp::TrustLevel trustLevel)
Sets the trust level trustLevel of keys for the encryption protocol namespace encryption. keyIds maps key owners' bare JIDs to the IDs of their keys.
If a key is not stored, it is added to the storage.
See also trustLevel().
QXmppTask<void> QXmppTrustManager::setTrustLevel(const QString &encryption, const QList<QString> &keyOwnerJids, QXmpp::TrustLevel oldTrustLevel, QXmpp::TrustLevel newTrustLevel)
Sets the trust level of keys specified by their key owner and trust level.
encryption is the encryption protocol namespace. keyOwnerJids are the key owners' bare JIDs. oldTrustLevel is the trust level being changed. newTrustLevel is the trust level being set.
QXmppTask<QXmpp::TrustLevel> QXmppTrustManager::trustLevel(const QString &encryption, const QString &keyOwnerJid, const QByteArray &keyId)
Returns the trust level of the key with ID keyId, owned by the JID keyOwnerJid, for the encryption protocol namespace encryption.
If the key is not stored, the trust in that key is undecided.
See also setTrustLevel().
[signal] void QXmppTrustManager::trustLevelsChanged(const QHash<QString, QMultiHash<QString, QByteArray>> &modifiedKeys)
Emitted when the trust levels of keys changed because setTrustLevel() added a new key or modified an existing one.
modifiedKeys maps key owners' bare JIDs to their modified keys for specific encryption protocol namespaces.