diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-07-07 14:47:41 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 14:47:41 +0900 |
commit | 6c9d895c03b9d0e7ffbf5bace3994536ff3215be (patch) | |
tree | d80e9fe022e631d76fae641eddc264f7306996de /lib/encryptionmanager.h | |
parent | f58819e4e930ee66e790eccaedf551f807956d72 (diff) | |
parent | d5b4e6440dae82eebc86657dd2f828edaf81b180 (diff) | |
download | libquotient-6c9d895c03b9d0e7ffbf5bace3994536ff3215be.tar.gz libquotient-6c9d895c03b9d0e7ffbf5bace3994536ff3215be.zip |
Merge pull request #329 from a-andreyev/aa13q-e2ee-enc-mng
E2EE: Introduce EncryptionManager with uploadIdentityKeys and uploadOneTimeKeys API.
Diffstat (limited to 'lib/encryptionmanager.h')
-rw-r--r-- | lib/encryptionmanager.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/encryptionmanager.h b/lib/encryptionmanager.h new file mode 100644 index 00000000..0bd05432 --- /dev/null +++ b/lib/encryptionmanager.h @@ -0,0 +1,31 @@ +#pragma once + +#include <functional> +#include <memory> +#include <QtCore/QObject> + +namespace QMatrixClient +{ + class Connection; + + class EncryptionManager: public QObject + { + Q_OBJECT + + public: + // TODO: store constats separately? + // TODO: 0.5 oneTimeKeyThreshold instead of 0.1? + explicit EncryptionManager(const QByteArray& encryptionAccountPickle, float signedKeysProportion = 1, float oneTimeKeyThreshold = float(0.1), + QObject* parent = nullptr); + ~EncryptionManager(); + + void uploadIdentityKeys(Connection* connection); + void uploadOneTimeKeys(Connection* connection, bool forceUpdate = false); + + private: + class Private; + std::unique_ptr<Private> d; + + }; + +} // namespace QMatrixClient |