diff options
| author | Melvin Keskin <melvo@olomono.de> | 2022-05-09 21:45:49 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-08-13 15:55:03 +0200 |
| commit | ceb62dd9d0d86bc8327ace116930962cf7fad1e9 (patch) | |
| tree | 35bdcccf3e1bebddadcdab6205383975ca66e4c4 /src/client/QXmppOmemoStorage.cpp | |
| parent | ec0669845b9072ea6cdc0fefb66f1d07511386a4 (diff) | |
| download | qxmpp-ceb62dd9d0d86bc8327ace116930962cf7fad1e9.tar.gz | |
Implement XEP-0384: OMEMO Encryption v0.8
This implements XEP-0384 in version v0.8 with a manager and storage
classes to be user-implemented for persistant storage.
The license of the code is LGPL-2.1-or-later as usual. However since
libomemo-c (libsignal-protocol-c) is GPL-3.0, the built binary is always
licensed under GPL-3.0. Having our code LGPL licensed will make it
avoids relicensing in the future in case we port it to an LGPL
compatible omemo library.
Closes #133.
Co-authored-by: Linus Jahn <lnj@kaidan.im>
Diffstat (limited to 'src/client/QXmppOmemoStorage.cpp')
| -rw-r--r-- | src/client/QXmppOmemoStorage.cpp | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/client/QXmppOmemoStorage.cpp b/src/client/QXmppOmemoStorage.cpp new file mode 100644 index 00000000..97b66dbe --- /dev/null +++ b/src/client/QXmppOmemoStorage.cpp @@ -0,0 +1,97 @@ +// SPDX-FileCopyrightText: 2022 Melvin Keskin <melvo@olomono.de> +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +/// +/// \class QXmppOmemoStorage +/// +/// \brief The QXmppOmemoStorage class stores data used by +/// \xep{0384, OMEMO Encryption}. +/// +/// \warning THIS API IS NOT FINALIZED YET! +/// +/// \since QXmpp 1.5 +/// + +/// +/// \fn QXmppOmemoStorage::allData() +/// +/// Returns all data used by OMEMO. +/// +/// \return the OMEMO data +/// + +/// +/// \fn QXmppOmemoStorage::setOwnDevice(const std::optional<OwnDevice> &device) +/// +/// Sets the own device (i.e., the device used by this client instance). +/// +/// \param device own device +/// + +/// +/// \fn QXmppOmemoStorage::addSignedPreKeyPair(uint32_t keyId, const SignedPreKeyPair &keyPair) +/// +/// Adds a signed pre key pair. +/// +/// \param keyId ID of the signed pre key pair +/// \param keyPair signed pre key pair +/// + +/// +/// \fn QXmppOmemoStorage::removeSignedPreKeyPair(uint32_t keyId) +/// +/// Removes a signed pre key pair. +/// +/// \param keyId ID of the signed pre key pair +/// + +/// +/// \fn QXmppOmemoStorage::addPreKeyPairs(const QHash<uint32_t, QByteArray> &keyPairs) +/// +/// Adds pre key pairs. +/// +/// \param keyPairs key IDs mapped to the pre key pairs +/// + +/// +/// \fn QXmppOmemoStorage::removePreKeyPair(uint32_t keyId) +/// +/// Removes a pre key pair. +/// +/// \param keyId ID of the pre key pair +/// + +/// +/// \fn QXmppOmemoStorage::addDevice(const QString &jid, uint32_t deviceId, const Device &device) +/// +/// Adds other devices (i.e., all devices but the own one). +/// +/// \param jid JID of the device owner +/// \param deviceId ID of the device +/// \param device device being added +/// + +/// +/// \fn QXmppOmemoStorage::removeDevice(const QString &jid, uint32_t deviceId) +/// +/// Removes a device of the other devices (i.e., all devices but the own one). +/// +/// \param jid JID of the device owner +/// \param deviceId ID of the device being removed +/// + +/// +/// \fn QXmppOmemoStorage::removeDevices(const QString &jid) +/// +/// Removes all devices of a passed JID from the other devices (i.e., all +/// devices but the own one). +/// +/// \param jid JID of the device owner +/// + +/// +/// \fn QXmppOmemoStorage::resetAll() +/// +/// Resets all data. +/// |
