diff options
author | Jack Lloyd <[email protected]> | 2017-11-19 13:11:17 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-11-26 11:34:12 -0500 |
commit | 9df1c8dab0c3b7218cbf40d743d73e9bd36c24cd (patch) | |
tree | 137e9107e7ca8b024ef5c36ce847b9cb75f1d3e9 /src/lib/psk_db/psk_db_sql.h | |
parent | fa5254e8982644b6b69d617b5fa2755a236cf028 (diff) |
PSK Database
Diffstat (limited to 'src/lib/psk_db/psk_db_sql.h')
-rw-r--r-- | src/lib/psk_db/psk_db_sql.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/psk_db/psk_db_sql.h b/src/lib/psk_db/psk_db_sql.h new file mode 100644 index 000000000..fddadfc30 --- /dev/null +++ b/src/lib/psk_db/psk_db_sql.h @@ -0,0 +1,34 @@ +/* +* (C) 2017 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#ifndef BOTAN_PSK_DB_SQL_H_ +#define BOTAN_PSK_DB_SQL_H_ + +#include <botan/psk_db.h> +#include <botan/database.h> + +namespace Botan { + +class BOTAN_PUBLIC_API(2,4) Encrypted_PSK_Database_SQL : public Encrypted_PSK_Database + { + public: + Encrypted_PSK_Database_SQL(const secure_vector<uint8_t>& master_key, + std::shared_ptr<SQL_Database> db, + const std::string& table_name); + + private: + void kv_set(const std::string& index, const std::string& value) override; + std::string kv_get(const std::string& index) const override; + void kv_del(const std::string& index) override; + std::set<std::string> kv_get_all() const override; + + std::shared_ptr<SQL_Database> m_db; + const std::string m_table_name; + }; + +} + +#endif |