10#include <botan/secmem.h>
19class MessageAuthenticationCode;
43 virtual void set(std::string_view
name,
const uint8_t psk[],
size_t psk_len) = 0;
59 std::string get_str(std::string_view
name)
const;
64 void set_str(std::string_view
name, std::string_view psk);
69 void set_vec(std::string_view
name, std::span<const uint8_t> psk) { set(
name, psk.data(), psk.size()); }
120 std::set<std::string> list_names()
const override;
124 void set(std::string_view
name,
const uint8_t psk[],
size_t psk_len)
override;
126 void remove(std::string_view
name)
override;
135 virtual void kv_set(std::string_view index, std::string_view value) = 0;
141 virtual std::string
kv_get(std::string_view index)
const = 0;
146 virtual void kv_del(std::string_view index) = 0;
155 std::unique_ptr<BlockCipher> m_cipher;
156 std::unique_ptr<MessageAuthenticationCode> m_hmac;
169 std::shared_ptr<SQL_Database> db,
170 std::string_view table_name);
175 void kv_set(std::string_view index, std::string_view value)
override;
176 std::string kv_get(std::string_view index)
const override;
177 void kv_del(std::string_view index)
override;
178 std::set<std::string> kv_get_all()
const override;
180 std::shared_ptr<SQL_Database> m_db;
181 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
void set_vec(std::string_view name, std::span< const uint8_t > psk)
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
#define BOTAN_PUBLIC_API(maj, min)
std::vector< T, secure_allocator< T > > secure_vector