Botan 3.6.1
Crypto and TLS for C&
|
#include <psk_db.h>
Public Member Functions | |
Encrypted_PSK_Database_SQL (const secure_vector< uint8_t > &master_key, std::shared_ptr< SQL_Database > db, std::string_view table_name) | |
secure_vector< uint8_t > | get (std::string_view name) const override |
std::string | get_str (std::string_view name) const |
bool | is_encrypted () const override |
std::set< std::string > | list_names () const override |
void | remove (std::string_view name) override |
void | set (std::string_view name, const uint8_t psk[], size_t psk_len) override |
void | set_str (std::string_view name, std::string_view psk) |
void | set_vec (std::string_view name, std::span< const uint8_t > psk) |
~Encrypted_PSK_Database_SQL () override | |
Botan::Encrypted_PSK_Database_SQL::Encrypted_PSK_Database_SQL | ( | const secure_vector< uint8_t > & | master_key, |
std::shared_ptr< SQL_Database > | db, | ||
std::string_view | table_name ) |
Creates or uses the named table in db
. The SQL schema of the table is (psk_name TEXT PRIMARY KEY, psk_value TEXT)
.
Definition at line 13 of file psk_db_sql.cpp.
|
overridedefault |
|
overridevirtualinherited |
name
or otherwise throw an exception. Implements Botan::PSK_Database.
Definition at line 63 of file psk_db.cpp.
References Botan::base64_decode(), Botan::base64_encode(), Botan::cast_char_ptr_to_uint8(), Botan::Encrypted_PSK_Database::kv_get(), name, Botan::nist_key_unwrap_padded(), and Botan::nist_key_wrap_padded().
|
inherited |
Get a PSK in the form of a string (eg if the PSK is a password)
Definition at line 18 of file psk_db.cpp.
References Botan::cast_uint8_ptr_to_char(), and Botan::PSK_Database::get().
|
inlineoverridevirtualinherited |
Implements Botan::PSK_Database.
Definition at line 128 of file psk_db.h.
|
overridevirtualinherited |
Implements Botan::PSK_Database.
Definition at line 38 of file psk_db.cpp.
References Botan::base64_decode(), Botan::cast_uint8_ptr_to_char(), Botan::Encrypted_PSK_Database::kv_get_all(), and Botan::nist_key_unwrap_padded().
|
overridevirtualinherited |
Remove the PSK with the given name
from the database
Implements Botan::PSK_Database.
Definition at line 56 of file psk_db.cpp.
References Botan::base64_encode(), Botan::cast_char_ptr_to_uint8(), Botan::Encrypted_PSK_Database::kv_del(), name, and Botan::nist_key_wrap_padded().
|
overridevirtualinherited |
Set a value that can later be accessed with get(). If name already exists in the database, the old value will be overwritten.
Implements Botan::PSK_Database.
Definition at line 81 of file psk_db.cpp.
References Botan::base64_encode(), Botan::cast_char_ptr_to_uint8(), Botan::Encrypted_PSK_Database::kv_set(), name, and Botan::nist_key_wrap_padded().
|
inherited |
Like set() but accepts the PSK as a string (eg for a password).
Definition at line 23 of file psk_db.cpp.
References Botan::cast_char_ptr_to_uint8(), and Botan::PSK_Database::set().
|
inlineinherited |