10#include <botan/secmem.h>
18class MessageAuthenticationCode;
42 virtual void set(std::string_view
name,
const uint8_t psk[],
size_t psk_len) = 0;
58 std::string get_str(std::string_view
name)
const;
60 void set_str(std::string_view
name, std::string_view psk);
62 template <
typename Alloc>
63 void set_vec(std::string_view
name,
const std::vector<uint8_t, Alloc>& psk) {
64 set(
name, psk.data(), psk.size());
94 std::set<std::string> list_names()
const override;
98 void set(std::string_view
name,
const uint8_t psk[],
size_t psk_len)
override;
100 void remove(std::string_view
name)
override;
108 virtual void kv_set(std::string_view index, std::string_view value) = 0;
114 virtual std::string
kv_get(std::string_view index)
const = 0;
119 virtual void kv_del(std::string_view index) = 0;
127 std::unique_ptr<BlockCipher> m_cipher;
128 std::unique_ptr<MessageAuthenticationCode> m_hmac;
137 std::shared_ptr<SQL_Database> db,
138 std::string_view table_name);
143 void kv_set(std::string_view index, std::string_view value)
override;
144 std::string kv_get(std::string_view index)
const override;
145 void kv_del(std::string_view index)
override;
146 std::set<std::string> kv_get_all()
const override;
148 std::shared_ptr<SQL_Database> m_db;
149 const std::string m_table_name;
~Encrypted_PSK_Database_SQL() override
bool is_encrypted() const override
virtual void kv_set(std::string_view index, std::string_view value)=0
virtual void kv_del(std::string_view index)=0
virtual std::string kv_get(std::string_view index) const =0
virtual std::set< std::string > kv_get_all() const =0
~Encrypted_PSK_Database() override
virtual std::set< std::string > list_names() const =0
virtual void set(std::string_view name, const uint8_t psk[], size_t psk_len)=0
virtual bool is_encrypted() const =0
virtual ~PSK_Database()=default
virtual secure_vector< uint8_t > get(std::string_view name) const =0
virtual void remove(std::string_view name)=0
void set_vec(std::string_view name, const std::vector< uint8_t, Alloc > &psk)
#define BOTAN_PUBLIC_API(maj, min)
std::vector< T, secure_allocator< T > > secure_vector