diff options
Diffstat (limited to 'src/ui/settings/GlobalSettingStation.h')
-rw-r--r-- | src/ui/settings/GlobalSettingStation.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/ui/settings/GlobalSettingStation.h b/src/ui/settings/GlobalSettingStation.h index 11c5e5f3..457a5a2f 100644 --- a/src/ui/settings/GlobalSettingStation.h +++ b/src/ui/settings/GlobalSettingStation.h @@ -27,6 +27,7 @@ #include <openssl/x509.h> +#include <nlohmann/json.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> @@ -91,7 +92,13 @@ class GlobalSettingStation : public QObject { void ResetRootCerts() { root_certs_.clear(); } - void Sync() noexcept; + void SyncSettings() noexcept; + + std::string SaveDataObj(const std::string& _key, const nlohmann::json& value); + + std::optional<nlohmann::json> GetDataObject(const std::string& _key); + + std::optional<nlohmann::json> GetDataObjectByRef(const std::string& _ref); private: // Program Location @@ -105,6 +112,9 @@ class GlobalSettingStation : public QObject { // Program Data Location boost::filesystem::path app_log_path = app_data_path / "logs"; + // object storage path + boost::filesystem::path app_data_objs_path = app_data_path / "objs"; + #ifdef LINUX_INSTALL_BUILD // Program Data Location boost::filesystem::path app_resource_path = @@ -127,6 +137,10 @@ class GlobalSettingStation : public QObject { QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) .toStdString(); + boost::filesystem::path app_secure_path = app_configure_path / "secure"; + + boost::filesystem::path app_secure_key_path = app_secure_path / "app.key"; + // Configure File Directory Location boost::filesystem::path ui_config_dir_path = app_configure_path / "UserInterface"; @@ -138,7 +152,17 @@ class GlobalSettingStation : public QObject { std::vector<std::shared_ptr<X509>> root_certs_; + std::random_device rd; + + std::mt19937 mt; + + QByteArray hash_key_; + static std::unique_ptr<GlobalSettingStation> _instance; + + void init_app_secure_key(); + + std::string generate_passphrase(int len); }; } // namespace GpgFrontend::UI |