diff options
author | Alexey Andreyev <aa13q@ya.ru> | 2019-06-22 19:57:18 +0300 |
---|---|---|
committer | Alexey Andreyev <aa13q@ya.ru> | 2019-07-04 11:21:06 +0300 |
commit | 69ba71cca36b4a90328d169c845195f39c041a3a (patch) | |
tree | dfcb78bc916b03e13a54c4f8cd707e3324cb2894 /lib/encryptionmanager.h | |
parent | 46a7350086e42ea3960fe54ef5c68b2207527899 (diff) | |
download | libquotient-69ba71cca36b4a90328d169c845195f39c041a3a.tar.gz libquotient-69ba71cca36b4a90328d169c845195f39c041a3a.zip |
Add EncryptionManager class. Add AccountSettings::encryptionAccountPickle logic.
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 |