#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, bool noninteractive); CryConfigCreator(CryConfigCreator &&rhs) = default; CryConfig create(const boost::optional &cipherFromCommandLine); private: std::string _generateCipher(const boost::optional &cipherFromCommandLine); std::string _generateEncKey(const std::string &cipher); std::string _generateRootBlobKey(); uint32_t _generateBlocksizeBytes(); std::shared_ptr _console; CryConfigConsole _configConsole; cpputils::RandomGenerator &_encryptionKeyGenerator; DISALLOW_COPY_AND_ASSIGN(CryConfigCreator); }; } #endif