9#ifndef BOTAN_TLS_SESSION_MANAGER_H_
10#define BOTAN_TLS_SESSION_MANAGER_H_
12#include <botan/mutex.h>
13#include <botan/tls_session.h>
14#include <botan/types.h>
16#if defined(BOTAN_HAS_TLS_13)
17 #include <botan/tls_psk_identity_13.h>
71 const std::optional<Session_ID>&
id = std::nullopt,
72 bool tls12_no_ticket =
false);
92#if defined(BOTAN_HAS_TLS_13)
121 const std::vector<PskIdentity>& tickets,
122 std::string_view hash_function,
275 std::shared_ptr<RandomNumberGenerator>
m_rng;
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_FUTURE_EXPLICIT
Helper class to embody a session handle in all protocol versions.
virtual std::optional< std::pair< Session, uint16_t > > choose_from_offered_tickets(const std::vector< PskIdentity > &tickets, std::string_view hash_function, Callbacks &callbacks, const Policy &policy)
virtual ~Session_Manager()=default
virtual size_t remove(const Session_Handle &handle)=0
virtual std::optional< Session > retrieve_one(const Session_Handle &handle)=0
Internal retrieval function for a single session.
virtual void store(const Session &session, const Session_Handle &handle)=0
Save a Session under a Session_Handle (TLS Client)
recursive_mutex_type & mutex()
BOTAN_FUTURE_EXPLICIT Session_Manager(const std::shared_ptr< RandomNumberGenerator > &rng)
virtual std::vector< Session_with_Handle > find_some(const Server_Information &info, size_t max_sessions_hint)=0
Internal retrieval function to find sessions to resume.
virtual std::optional< Session_Handle > establish(const Session &session, const std::optional< Session_ID > &id=std::nullopt, bool tls12_no_ticket=false)
Save a new Session and assign a Session_Handle (TLS Server)
virtual bool emits_session_tickets()
virtual std::vector< Session_with_Handle > find(const Server_Information &info, Callbacks &callbacks, const Policy &policy)
Find all sessions that match a given server info.
std::shared_ptr< RandomNumberGenerator > m_rng
virtual size_t remove_all()=0
virtual std::optional< Session > retrieve(const Session_Handle &handle, Callbacks &callbacks, const Policy &policy)
Retrieves a specific session given a handle.
noop_mutex recursive_mutex_type