Skip to content
Snippets Groups Projects
crypto_storage.cc 858 B
Newer Older
  • Learn to ignore specific revisions
  • Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
    #include <vereign/kvstore/crypto_storage.hh>
    
    #if defined(_WIN32)
    
    // # include <vereign/kvstore/detail/win_crypto_storage.hh>
    # include <vereign/kvstore/detail/linux_crypto_storage.hh>
    
    Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
    #else
    # include <vereign/kvstore/detail/linux_crypto_storage.hh>
    #endif
    
    namespace vereign::kvstore {
    
    CryptoStorage::CryptoStorage(kvstore::Storage& storage)
      : impl_{std::make_unique<detail::CryptoStorageImpl>(storage)}
    {}
    
    CryptoStorage::~CryptoStorage() = default;
    
    void CryptoStorage::Reset(const std::string& pin) {
      impl_->Reset(pin);
    }
    
    void CryptoStorage::Open(const std::string& pin) {
      impl_->Open(pin);
    }
    
    void CryptoStorage::PutBytes(const std::string& key, bytes::View value) {
      impl_->PutBytes(key, value);
    }
    
    void CryptoStorage::GetBytes(const std::string& key, bytes::Buffer& value) {
      impl_->GetBytes(key, value);
    }
    
    } // namespace vereign::identity