9#ifndef BOTAN_TLS_SESSION_MANAGER_HYBRID_H_
10#define BOTAN_TLS_SESSION_MANAGER_HYBRID_H_
12#include <botan/tls_session_manager.h>
13#include <botan/tls_session_manager_stateless.h>
53 const std::shared_ptr<Credentials_Manager>& credentials_manager,
54 const std::shared_ptr<RandomNumberGenerator>& rng,
55 bool prefer_tickets =
true);
58 const std::optional<Session_ID>&
id = std::nullopt,
59 bool tls12_no_ticket =
false)
override;
63 const Policy& policy)
override;
67 const Policy& policy)
override {
68 return m_stateful->find(info, callbacks, policy);
75 size_t remove_all()
override {
return m_stateful->remove_all(); }
77 bool emits_session_tickets()
override;
85 std::optional<Session> retrieve_one(
const Session_Handle&)
override;
87 std::vector<Session_with_Handle> find_some(
const Server_Information&,
const size_t)
override;
90 std::unique_ptr<Session_Manager> m_stateful;
93 bool m_prefer_tickets;
#define BOTAN_PUBLIC_API(maj, min)
Helper class to embody a session handle in all protocol versions.
std::optional< Session > retrieve(const Session_Handle &handle, Callbacks &callbacks, const Policy &policy) override
Retrieves a specific session given a handle.
size_t remove(const Session_Handle &handle) override
Session_Manager_Hybrid(std::unique_ptr< Session_Manager > stateful_manager, const std::shared_ptr< Credentials_Manager > &credentials_manager, const std::shared_ptr< RandomNumberGenerator > &rng, bool prefer_tickets=true)
size_t remove_all() override
void store(const Session &session, const Session_Handle &handle) override
Save a Session under a Session_Handle (TLS Client)
std::vector< Session_with_Handle > find(const Server_Information &info, Callbacks &callbacks, const Policy &policy) override
Find all sessions that match a given server info.
std::optional< Session_Handle > establish(const Session &session, const std::optional< Session_ID > &id=std::nullopt, bool tls12_no_ticket=false) override
Save a new Session and assign a Session_Handle (TLS Server)
Session_Manager * underlying_stateful_manager()
Session_Manager(const std::shared_ptr< RandomNumberGenerator > &rng)