Skip to content
Snippets Groups Projects
crypto_storage.hh 692 B
Newer Older
  • Learn to ignore specific revisions
  • Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
    #ifndef __VEREIGN_KVSTORE_CRYPTO_STORAGE_HH
    #define __VEREIGN_KVSTORE_CRYPTO_STORAGE_HH
    
    #include <vereign/kvstore/storage.hh>
    #include <memory>
    
    namespace vereign::kvstore {
    
    namespace detail {
    
    class CryptoStorageImpl;
    
    }
    
    class CryptoStorage {
    public:
    
      CryptoStorage(Storage& storage, bool disable_key_protection = false);
    
    Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
      ~CryptoStorage();
    
      void Reset(const std::string& pin);
      void Open(const std::string& pin);
    
      void PutBytes(const std::string& key, bytes::View value);
      void GetBytes(const std::string& key, bytes::Buffer& value);
    
    private:
      std::unique_ptr<detail::CryptoStorageImpl> impl_;
    };
    
    } // namespace vereign::kvstore
    
    #endif // __VEREIGN_KVSTORE_CRYPTO_STORAGE_HH