#pragma once #ifndef MESSMER_CRYFS_SRC_CONFIG_CRYCONFIGFILE_H #define MESSMER_CRYFS_SRC_CONFIG_CRYCONFIGFILE_H #include #include #include "CryConfig.h" #include #include "crypto/CryConfigEncryptorFactory.h" namespace cryfs { class CryConfigFile final { public: CryConfigFile(CryConfigFile &&rhs) = default; ~CryConfigFile(); static CryConfigFile create(const boost::filesystem::path &path, CryConfig config, const std::string &password, const cpputils::SCryptSettings &scryptSettings); static boost::optional load(const boost::filesystem::path &path, const std::string &password); void save() const; CryConfig *config(); private: CryConfigFile(const boost::filesystem::path &path, CryConfig config, cpputils::unique_ref encryptor); boost::filesystem::path _path; CryConfig _config; cpputils::unique_ref _encryptor; DISALLOW_COPY_AND_ASSIGN(CryConfigFile); }; } #endif