2016-01-17 14:57:40 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef MESSMER_CRYFS_SRC_CONFIG_CRYCONFIGCONSOLE_H
|
|
|
|
#define MESSMER_CRYFS_SRC_CONFIG_CRYCONFIGCONSOLE_H
|
|
|
|
|
2016-02-11 16:39:42 +01:00
|
|
|
#include <cpp-utils/pointer/unique_ref.h>
|
|
|
|
#include <cpp-utils/io/Console.h>
|
2016-01-17 14:57:40 +01:00
|
|
|
#include <boost/optional.hpp>
|
|
|
|
|
|
|
|
namespace cryfs {
|
|
|
|
class CryConfigConsole final {
|
|
|
|
public:
|
|
|
|
CryConfigConsole(std::shared_ptr<cpputils::Console> console);
|
|
|
|
CryConfigConsole(CryConfigConsole &&rhs) = default;
|
|
|
|
|
2016-01-25 14:33:40 +01:00
|
|
|
std::string askCipher();
|
2016-01-17 14:57:40 +01:00
|
|
|
|
|
|
|
static constexpr const char *DEFAULT_CIPHER = "aes-256-gcm";
|
|
|
|
|
2016-01-25 14:33:40 +01:00
|
|
|
private:
|
|
|
|
bool _checkUseDefaultSettings();
|
|
|
|
|
|
|
|
std::string _askCipher() const;
|
2016-01-17 14:57:40 +01:00
|
|
|
bool _showWarningForCipherAndReturnIfOk(const std::string &cipherName) const;
|
|
|
|
|
|
|
|
std::shared_ptr<cpputils::Console> _console;
|
2016-01-25 14:33:40 +01:00
|
|
|
boost::optional<bool> _useDefaultSettings;
|
2016-01-17 14:57:40 +01:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CryConfigConsole);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|