libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
sssshandler.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
2
// SPDX-License-Identifier: LGPL-2.0-or-later
3
4
#
pragma
once
5
6
#
include
"cryptoutils.h"
7
8
#
include
"../connection.h"
9
10
#
include
<
QtCore
/
QObject
>
11
#
include
<
QtCore
/
QPointer
>
12
13
namespace
Quotient
{
14
class
QUOTIENT_API
SSSSHandler
:
public
QObject
15
{
16
Q_OBJECT
17
QML_ELEMENT
18
Q_PROPERTY
(
Quotient
::
Connection
*
connection
READ
connection
WRITE
setConnection
NOTIFY
connectionChanged
)
19
20
public
:
21
enum
Error
22
{
23
WrongKeyError
,
24
NoKeyError
,
25
DecryptionError
,
26
InvalidSignatureError
,
27
UnsupportedAlgorithmError
,
28
};
29
Q_ENUM
(
Error
)
30
31
using
QObject
::
QObject
;
32
33
//! \brief Unlock the secret backup from the given passprhase
34
Q_INVOKABLE
void
unlockSSSSWithPassphrase
(
const
QString
&
passphrase
);
35
36
//! \brief Unlock the secret backup by requesting the decryption keys from other devices
37
Q_INVOKABLE
void
unlockSSSSFromCrossSigning
();
38
39
//! \brief Unlock the secret backup from the given security key
40
Q_INVOKABLE
void
unlockSSSSFromSecurityKey
(
const
QString
&
encodedKey
);
41
42
Connection
*
connection
()
const
;
43
void
setConnection
(
Connection
*
connection
);
44
45
Q_SIGNALS
:
46
void
keyBackupUnlocked
();
47
void
error
(
Error
error
);
48
void
connectionChanged
();
49
50
//! \brief Emitted after keys are loaded
51
void
finished
();
52
53
private
:
54
QPointer
<
Connection
>
m_connection
;
55
56
//! \brief Decrypt the key with this name from the account data
57
QByteArray
decryptKey
(
event_type_t
keyType
,
const
QString
&
defaultKey
,
key_view_t
decryptionKey
);
58
59
void
loadMegolmBackup
(
const
QByteArray
&
megolmDecryptionKey
);
60
struct
UnlockData
;
61
void
unlockAndLoad
(
const
UnlockData
&
unlockData
,
key_view_t
decryptingKey
);
62
};
63
}
// namespace Quotient
Quotient::SSSSHandler
Definition
sssshandler.h:15
Quotient
Definition
accountregistry.h:13
QUOTIENT_API
#define QUOTIENT_API
Definition
quotient_export.h:22
Quotient
e2ee
sssshandler.h
Generated by
1.9.8