#pragma once #ifndef MESSMER_CRYFS_SRC_CONFIG_CRYCONFIGCREATOR_H #define MESSMER_CRYFS_SRC_CONFIG_CRYCONFIGCREATOR_H #include #include #include #include "CryConfig.h" #include "CryConfigConsole.h" namespace cryfs { class CryConfigCreator final { public: CryConfigCreator(std::shared_ptr console, cpputils::RandomGenerator &encryptionKeyGenerator); CryConfigCreator(CryConfigCreator &&rhs) = default; CryConfig create(const boost::optional &cipherFromCommandLine, const boost::optional &blocksizeBytesFromCommandLine); private: std::string _generateCipher(const boost::optional &cipherFromCommandLine); std::string _generateEncKey(const std::string &cipher); std::string _generateRootBlobKey(); uint32_t _generateBlocksizeBytes(const boost::optional &blocksizeBytesFromCommandLine); CryConfig::FilesystemID _generateFilesystemID(); std::shared_ptr _console; CryConfigConsole _configConsole; cpputils::RandomGenerator &_encryptionKeyGenerator; DISALLOW_COPY_AND_ASSIGN(CryConfigCreator); }; } #endif