#pragma once #include #include #include class Encryption { public: void createNewDeviceKeys(); QJsonObject generateOneTimeKeys(int number); int getRecommendedNumberOfOneTimeKeys(); QString saveDeviceKeys(); void loadDeviceKeys(QString bytes); OlmOutboundGroupSession* beginOutboundSession(); std::string getGroupSessionId(OlmOutboundGroupSession* session); std::string getGroupSessionKey(OlmOutboundGroupSession* session); OlmSession* beginOutboundOlmSession(std::string identityKey, std::string oneTimeKey); std::string getSessionId(OlmSession* session); std::string encrypt(OlmSession* session, std::string message); std::string encryptGroup(OlmOutboundGroupSession* session, std::string message); QString saveSession(OlmOutboundGroupSession* session); OlmOutboundGroupSession* loadSession(QString bytes); // inbound messaging OlmSession* createInboundSession(std::string senderKey, std::string body); std::vector decrypt(OlmSession* session, int msgType, std::string cipherText); OlmInboundGroupSession* beginInboundSession(std::string sessionKey); std::vector decrypt(OlmInboundGroupSession* session, std::string cipherText); QString signMessage(QString message); QJsonObject identityKey; private: void initAccount(); OlmAccount* account = nullptr; };