libcryfs/src/config/CryCipher.h
2015-10-28 01:49:33 +01:00

38 lines
1.0 KiB
C++

#pragma once
#ifndef MESSMER_CRYFS_SRC_CONFIG_CRYCIPHER_H
#define MESSMER_CRYFS_SRC_CONFIG_CRYCIPHER_H
#include <vector>
#include <string>
#include <messmer/cpp-utils/pointer/unique_ref.h>
#include <messmer/blockstore/interface/BlockStore.h>
#include <messmer/cpp-utils/random/RandomGenerator.h>
namespace cryfs {
class CryCipher {
public:
virtual ~CryCipher() {}
virtual std::string cipherName() const = 0;
virtual const boost::optional<std::string> &warning() const = 0;
virtual cpputils::unique_ref<blockstore::BlockStore> createEncryptedBlockstore(cpputils::unique_ref<blockstore::BlockStore> baseBlockStore, const std::string &encKey) const = 0;
virtual std::string createKey(cpputils::RandomGenerator &randomGenerator) const = 0;
};
class CryCiphers {
public:
static std::vector<std::string> supportedCipherNames();
static const CryCipher& find(const std::string &cipherName);
private:
static const std::string INTEGRITY_WARNING;
static const std::vector<std::shared_ptr<CryCipher>> SUPPORTED_CIPHERS;
};
}
#endif