QXmpp
Version: 1.10.0
src
client
QXmppTrustManager.h
1
// SPDX-FileCopyrightText: 2022 Melvin Keskin <melvo@olomono.de>
2
//
3
// SPDX-License-Identifier: LGPL-2.1-or-later
4
5
#ifndef QXMPPTRUSTMANAGER_H
6
#define QXMPPTRUSTMANAGER_H
7
8
#include "QXmppClientExtension.h"
9
#include "QXmppTrustLevel.h"
10
#include "QXmppTrustSecurityPolicy.h"
11
12
template
<
typename
T>
13
class
QXmppTask
;
14
15
class
QXmppTrustStorage
;
16
17
class
QXMPP_EXPORT
QXmppTrustManager
:
public
QXmppClientExtension
18
{
19
Q_OBJECT
20
21
public
:
22
QXmppTrustManager
(
QXmppTrustStorage
*trustStorage);
23
~QXmppTrustManager
();
24
25
QXmppTask<void>
setSecurityPolicy(
const
QString &encryption,
QXmpp::TrustSecurityPolicy
securityPolicy);
26
QXmppTask<void>
resetSecurityPolicy(
const
QString &encryption);
27
QXmppTask<QXmpp::TrustSecurityPolicy>
securityPolicy(
const
QString &encryption);
28
29
QXmppTask<void>
setOwnKey(
const
QString &encryption,
const
QByteArray &keyId);
30
QXmppTask<void>
resetOwnKey(
const
QString &encryption);
31
QXmppTask<QByteArray>
ownKey(
const
QString &encryption);
32
33
QXmppTask<void>
addKeys(
const
QString &encryption,
const
QString &keyOwnerJid,
const
QList<QByteArray> &keyIds,
QXmpp::TrustLevel
trustLevel =
QXmpp::TrustLevel::AutomaticallyDistrusted
);
34
QXmppTask<void>
removeKeys(
const
QString &encryption,
const
QList<QByteArray> &keyIds);
35
QXmppTask<void>
removeKeys(
const
QString &encryption,
const
QString &keyOwnerJid);
36
QXmppTask<void>
removeKeys(
const
QString &encryption);
37
QXmppTask<QHash<QXmpp::TrustLevel, QMultiHash<QString, QByteArray>
>> keys(
const
QString &encryption, QXmpp::TrustLevels trustLevels = {});
38
QXmppTask<QHash<QString, QHash<QByteArray, QXmpp::TrustLevel>
>> keys(
const
QString &encryption,
const
QList<QString> &keyOwnerJids, QXmpp::TrustLevels trustLevels = {});
39
QXmppTask<bool>
hasKey(
const
QString &encryption,
const
QString &keyOwnerJid, QXmpp::TrustLevels trustLevels);
40
41
QXmppTask<void>
setTrustLevel(
const
QString &encryption,
const
QMultiHash<QString, QByteArray> &keyIds,
QXmpp::TrustLevel
trustLevel);
42
QXmppTask<void>
setTrustLevel(
const
QString &encryption,
const
QList<QString> &keyOwnerJids,
QXmpp::TrustLevel
oldTrustLevel,
QXmpp::TrustLevel
newTrustLevel);
43
QXmppTask<QXmpp::TrustLevel>
trustLevel(
const
QString &encryption,
const
QString &keyOwnerJid,
const
QByteArray &keyId);
44
45
QXmppTask<void>
resetAll(
const
QString &encryption);
46
47
Q_SIGNAL
void
trustLevelsChanged
(
const
QHash<QString, QMultiHash<QString, QByteArray>> &modifiedKeys);
48
49
protected
:
51
inline
QXmppTrustStorage
*trustStorage()
const
52
{
53
return
m_trustStorage;
54
}
56
57
private
:
58
QXmppTrustStorage
*m_trustStorage;
59
};
60
61
#endif
// QXMPPTRUSTMANAGER_H
QXmppClientExtension
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition:
QXmppClientExtension.h:32
QXmppTask
Definition:
QXmppTask.h:62
QXmppTrustManager
The QXmppTrustManager manages end-to-end encryption trust decisions.
Definition:
QXmppTrustManager.h:18
QXmppTrustManager::trustLevelsChanged
Q_SIGNAL void trustLevelsChanged(const QHash< QString, QMultiHash< QString, QByteArray > > &modifiedKeys)
QXmppTrustStorage
The QXmppTrustStorage class stores end-to-end encryption trust data.
Definition:
QXmppTrustStorage.h:16
QXmpp::TrustLevel
TrustLevel
Definition:
QXmppTrustLevel.h:19
QXmpp::TrustLevel::AutomaticallyDistrusted
@ AutomaticallyDistrusted
QXmpp::TrustSecurityPolicy
TrustSecurityPolicy
Definition:
QXmppTrustSecurityPolicy.h:18
Generated by
1.9.4