#pragma once #ifndef BLOCKSTORE_IMPLEMENTATIONS_ENCRYPTED_ENCRYPTEDBLOCKSTORE_H_ #define BLOCKSTORE_IMPLEMENTATIONS_ENCRYPTED_ENCRYPTEDBLOCKSTORE_H_ #include "../../interface/BlockStore.h" #include #include "EncryptionKey.h" namespace blockstore { namespace encrypted { class EncryptedBlockStore: public BlockStore { public: EncryptedBlockStore(std::unique_ptr baseBlockStore, const EncryptionKey &encKey); Key createKey() override; std::unique_ptr tryCreate(const Key &key, Data data) override; std::unique_ptr load(const Key &key) override; void remove(std::unique_ptr block) override; uint64_t numBlocks() const override; std::unique_ptr tryCreateInBaseStore(const Key &key, Data encryptedData); private: std::unique_ptr _baseBlockStore; EncryptionKey _encKey; DISALLOW_COPY_AND_ASSIGN(EncryptedBlockStore); }; } } #endif