8#ifndef BOTAN_TLS_SQL_SESSION_MANAGER_H_
9#define BOTAN_TLS_SQL_SESSION_MANAGER_H_
11#include <botan/database.h>
12#include <botan/symkey.h>
13#include <botan/tls_session_manager.h>
44 std::string_view passphrase,
45 const std::shared_ptr<RandomNumberGenerator>& rng,
46 size_t max_sessions = 1000);
61 std::optional<Session> retrieve_one(
const Session_Handle& handle)
override;
62 std::vector<Session_with_Handle> find_some(
const Server_Information& info,
size_t max_sessions_hint)
override;
79 enum Schema_Revision {
82 PRE_BOTAN_3_0 = 20120609,
86 void create_or_migrate_and_open(std::string_view passphrase);
87 Schema_Revision detect_schema_revision();
88 void create_with_latest_schema(std::string_view passphrase, Schema_Revision rev);
89 void initialize_existing_database(std::string_view passphrase);
91 void prune_session_cache();
94 std::shared_ptr<SQL_Database> m_db;
96 size_t m_max_sessions;
#define BOTAN_PUBLIC_API(maj, min)
Helper class to embody a session handle in all protocol versions.
bool emits_session_tickets() override
Session_Manager_SQL(std::shared_ptr< SQL_Database > db, std::string_view passphrase, const std::shared_ptr< RandomNumberGenerator > &rng, size_t max_sessions=1000)
void store(const Session &session, const Session_Handle &handle) override
Save a Session under a Session_Handle (TLS Client).
size_t remove(const Session_Handle &handle) override
~Session_Manager_SQL() override=default
virtual bool database_is_threadsafe() const
size_t remove_all() override
Session_Manager_SQL & operator=(const Session_Manager_SQL &)=delete
Session_Manager_SQL(const Session_Manager_SQL &)=delete
Session_Manager_SQL(Session_Manager_SQL &&)=delete
Session_Manager_SQL & operator=(Session_Manager_SQL &&)=delete
BOTAN_FUTURE_EXPLICIT Session_Manager(const std::shared_ptr< RandomNumberGenerator > &rng)