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>
41 std::string_view passphrase,
42 const std::shared_ptr<RandomNumberGenerator>& rng,
43 size_t max_sessions = 1000);
58 std::optional<Session> retrieve_one(
const Session_Handle& handle)
override;
59 std::vector<Session_with_Handle> find_some(
const Server_Information& info,
size_t max_sessions_hint)
override;
76 enum Schema_Revision {
79 PRE_BOTAN_3_0 = 20120609,
83 void create_or_migrate_and_open(std::string_view passphrase);
84 Schema_Revision detect_schema_revision();
85 void create_with_latest_schema(std::string_view passphrase, Schema_Revision rev);
86 void initialize_existing_database(std::string_view passphrase);
88 void prune_session_cache();
91 std::shared_ptr<SQL_Database> m_db;
93 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)