libcryfs/src/config/CryConfigCreator.h

29 lines
908 B
C
Raw Normal View History

2015-10-19 02:46:47 +02:00
#ifndef CRYFS_SRC_CONFIG_CRYCONFIGCREATOR_H
#define CRYFS_SRC_CONFIG_CRYCONFIGCREATOR_H
#include <messmer/cpp-utils/pointer/unique_ref.h>
2015-10-22 18:48:04 +02:00
#include <messmer/cpp-utils/random/RandomGenerator.h>
2015-10-19 02:46:47 +02:00
#include <messmer/cpp-utils/io/Console.h>
#include "CryConfig.h"
namespace cryfs {
class CryConfigCreator final {
public:
2015-10-22 18:48:04 +02:00
CryConfigCreator(cpputils::unique_ref<cpputils::Console> console, cpputils::RandomGenerator &encryptionKeyGenerator);
2015-10-19 02:46:47 +02:00
CryConfig create();
private:
std::string _generateCipher();
std::string _generateEncKey(const std::string &cipher);
std::string _generateRootBlobKey();
bool _showWarningForCipherAndReturnIfOk(const std::string &cipherName);
cpputils::unique_ref<cpputils::Console> _console;
2015-10-22 18:48:04 +02:00
cpputils::RandomGenerator &_encryptionKeyGenerator;
2015-10-19 02:46:47 +02:00
DISALLOW_COPY_AND_ASSIGN(CryConfigCreator);
};
}
#endif