8 #ifndef BOTAN_TLS_SESSION_MANAGER_H_
9 #define BOTAN_TLS_SESSION_MANAGER_H_
11 #include <botan/tls_session.h>
12 #include <botan/mutex.h>
39 virtual bool load_from_session_id(
const std::vector<uint8_t>& session_id,
55 virtual void remove_entry(
const std::vector<uint8_t>& session_id) = 0;
60 virtual size_t remove_all() = 0;
70 virtual void save(
const Session& session) = 0;
77 virtual std::chrono::seconds session_lifetime()
const = 0;
102 {
return std::chrono::seconds(0); }
120 size_t max_sessions = 1000,
121 std::chrono::seconds session_lifetime =
122 std::chrono::seconds(7200));
124 bool load_from_session_id(
const std::vector<uint8_t>& session_id,
130 void remove_entry(
const std::vector<uint8_t>& session_id)
override;
132 size_t remove_all()
override;
134 void save(
const Session& session_data)
override;
137 {
return m_session_lifetime; }
140 bool load_from_session_str(
const std::string& session_str,
145 size_t m_max_sessions;
147 std::chrono::seconds m_session_lifetime;
152 std::map<std::string, std::vector<uint8_t>> m_sessions;
153 std::map<Server_Information, std::string> m_info_sessions;
size_t remove_all() override
bool load_from_server_info(const Server_Information &, Session &) override
std::chrono::seconds session_lifetime() const override
void save(const Session &) override
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::vector< T, secure_allocator< T >> secure_vector
RandomNumberGenerator & m_rng
bool load_from_session_id(const std::vector< uint8_t > &, Session &) override
std::chrono::seconds session_lifetime() const override
void remove_entry(const std::vector< uint8_t > &) override