8 #include <Quotient/e2ee/e2ee_common.h>
9 #include <Quotient/e2ee/qolmmessage.h>
11 #include <Quotient/csapi/keys.h>
13 #include <QtCore/QObject>
29 QOlmAccount(QString userId, QString deviceId, QObject* parent =
nullptr);
36 void setupNewAccount();
40 [[nodiscard]] OlmErrorCode unpickle(QByteArray&& pickled,
41 const PicklingKey& key);
44 QByteArray pickle(
const PicklingKey& key)
const;
47 IdentityKeys identityKeys()
const;
50 QByteArray sign(
const QByteArray &message)
const;
51 QByteArray sign(
const QJsonObject& message)
const;
54 QByteArray signIdentityKeys()
const;
58 size_t maxNumberOfOneTimeKeys()
const;
61 size_t generateOneTimeKeys(size_t numberOfKeys);
64 UnsignedOneTimeKeys oneTimeKeys()
const;
67 OneTimeKeys signOneTimeKeys(
const UnsignedOneTimeKeys &keys)
const;
69 UploadKeysJob* createUploadKeyRequest(
const UnsignedOneTimeKeys& oneTimeKeys)
const;
71 DeviceKeys deviceKeys()
const;
74 [[nodiscard]] OlmErrorCode removeOneTimeKeys(
const QOlmSession& session);
79 QOlmExpected<QOlmSession> createInboundSession(
80 const QOlmMessage& preKeyMessage)
const;
86 QOlmExpected<QOlmSession> createInboundSessionFrom(
87 const QByteArray& theirIdentityKey,
88 const QOlmMessage& preKeyMessage)
const;
92 QOlmExpected<QOlmSession> createOutboundSession(
93 const QByteArray& theirIdentityKey,
94 const QByteArray& theirOneTimeKey)
const;
96 void markKeysAsPublished();
98 OlmErrorCode lastErrorCode()
const;
99 const char* lastError()
const;
105 CStructPtr<OlmAccount> olmDataHolder;
108 OlmAccount* olmData = olmDataHolder.get();
110 QOlmExpected<QOlmSession> createInbound(QOlmMessage preKeyMessage,
111 const QByteArray &theirIdentityKey =
"")
const;
113 QString accountId()
const;
118 QUOTIENT_API bool verifyIdentitySignature(
const DeviceKeys& deviceKeys,
119 const QString& deviceId,
120 const QString& userId);
124 const QJsonObject& obj,
125 const QString& signature);