2015-10-15 13:06:51 +02:00
|
|
|
#pragma once
|
|
|
|
#ifndef MESSMER_CRYFS_SRC_CONFIG_CRYCIPHER_H
|
|
|
|
#define MESSMER_CRYFS_SRC_CONFIG_CRYCIPHER_H
|
2015-09-01 00:25:14 +02:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <messmer/cpp-utils/pointer/unique_ref.h>
|
|
|
|
#include <messmer/blockstore/interface/BlockStore.h>
|
|
|
|
|
|
|
|
namespace cryfs {
|
|
|
|
|
|
|
|
class CryCipher {
|
|
|
|
public:
|
2015-10-17 21:33:41 +02:00
|
|
|
virtual ~CryCipher() {}
|
|
|
|
|
2015-09-04 16:02:55 +02:00
|
|
|
virtual const std::string &cipherName() const = 0;
|
|
|
|
virtual const boost::optional<std::string> &warning() const = 0;
|
2015-09-01 00:25:14 +02:00
|
|
|
virtual cpputils::unique_ref<blockstore::BlockStore> createEncryptedBlockstore(cpputils::unique_ref<blockstore::BlockStore> baseBlockStore, const std::string &encKey) const = 0;
|
|
|
|
virtual std::string createKey() const = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CryCiphers {
|
|
|
|
public:
|
2015-09-04 16:02:55 +02:00
|
|
|
static std::vector<std::string> supportedCipherNames();
|
2015-09-01 00:25:14 +02:00
|
|
|
|
|
|
|
static const CryCipher& find(const std::string &cipherName);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const std::vector<std::shared_ptr<CryCipher>> SUPPORTED_CIPHERS;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|