libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
keyimport.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
2
// SPDX-License-Identifier: LGPL-2.0-or-later
3
4
#
pragma
once
5
6
#
include
"expected.h"
// Only here to not break client code still using Expected
7
#
include
"quotient_export.h"
8
9
#
include
<
QtCore
/
QObject
>
10
#
include
<
QtQmlIntegration
/
qqmlintegration
.
h
>
11
12
class
TestKeyImport;
13
14
namespace
Quotient
15
{
16
class
Connection;
17
}
18
19
namespace
Quotient
20
{
21
22
class
QUOTIENT_API
KeyImport
:
public
QObject
23
{
24
Q_OBJECT
25
QML_ELEMENT
26
QML_SINGLETON
27
28
public
:
29
enum
Error
{
30
Success
,
31
InvalidPassphrase
,
32
InvalidData
,
33
OtherError
,
34
};
35
Q_ENUM
(
Error
)
36
37
using
QObject
::
QObject
;
38
39
Q_INVOKABLE
Error
importKeys
(
QString
data
,
const
QString
&
passphrase
,
40
const
Quotient
::
Connection
*
connection
);
41
Q_INVOKABLE
std
::
expected
<
QByteArray
,
Error
>
exportKeys
(
const
QString
&
passphrase
,
42
const
Quotient
::
Connection
*
connection
);
43
44
friend
class
::
TestKeyImport
;
45
46
private
:
47
std
::
expected
<
QJsonArray
,
Error
>
decrypt
(
QString
data
,
const
QString
&
passphrase
);
48
std
::
expected
<
QByteArray
,
Error
>
encrypt
(
QJsonArray
sessions
,
const
QString
&
passphrase
);
49
};
50
51
}
Quotient::KeyImport
Definition
keyimport.h:23
Quotient
Definition
accountregistry.h:13
QUOTIENT_API
#define QUOTIENT_API
Definition
quotient_export.h:22
Quotient
keyimport.h
Generated by
1.9.8