Botan
2.17.3
Crypto and TLS for C++11
|
#include <tls_session_manager_sqlite.h>
Public Member Functions | |
bool | load_from_server_info (const Server_Information &info, Session &session) override |
bool | load_from_session_id (const std::vector< uint8_t > &session_id, Session &session) override |
size_t | remove_all () override |
void | remove_entry (const std::vector< uint8_t > &session_id) override |
void | save (const Session &session_data) override |
std::chrono::seconds | session_lifetime () const override |
Session_Manager_SQLite (const std::string &passphrase, RandomNumberGenerator &rng, const std::string &db_filename, size_t max_sessions=1000, std::chrono::seconds session_lifetime=std::chrono::seconds(7200)) | |
An implementation of Session_Manager that saves values in a SQLite3 database file, with the session data encrypted using a passphrase.
Definition at line 27 of file tls_session_manager_sqlite.h.
Botan::TLS::Session_Manager_SQLite::Session_Manager_SQLite | ( | const std::string & | passphrase, |
RandomNumberGenerator & | rng, | ||
const std::string & | db_filename, | ||
size_t | max_sessions = 1000 , |
||
std::chrono::seconds | session_lifetime = std::chrono::seconds(7200) |
||
) |
passphrase | used to encrypt the session data |
rng | a random number generator |
db_filename | filename of the SQLite database file. The table names tls_sessions and tls_sessions_metadata will be used |
max_sessions | a hint on the maximum number of sessions to keep in memory at any one time. (If zero, don't cap) |
session_lifetime | sessions are expired after this many seconds have elapsed from initial handshake. |
Definition at line 15 of file tls_session_manager_sqlite.cpp.
|
overridevirtualinherited |
Try to load a saved session (using info about server)
info | the information about the server |
session | will be set to the saved session data (if found), or not modified if not found |
Implements Botan::TLS::Session_Manager.
Definition at line 130 of file tls_session_manager_sql.cpp.
References Botan::TLS::Session::decrypt(), Botan::TLS::Server_Information::hostname(), and Botan::TLS::Server_Information::port().
|
overridevirtualinherited |
Try to load a saved session (using session ID)
session_id | the session identifier we are trying to resume |
session | will be set to the saved session data (if found), or not modified if not found |
Implements Botan::TLS::Session_Manager.
Definition at line 106 of file tls_session_manager_sql.cpp.
References Botan::TLS::Session::decrypt(), and Botan::hex_encode().
|
overridevirtualinherited |
Remove all sessions from the cache, return number of sessions deleted
Implements Botan::TLS::Session_Manager.
Definition at line 166 of file tls_session_manager_sql.cpp.
|
overridevirtualinherited |
Remove this session id from the cache, if it exists
Implements Botan::TLS::Session_Manager.
Definition at line 157 of file tls_session_manager_sql.cpp.
References Botan::hex_encode().
|
overridevirtualinherited |
Save a session on a best effort basis; the manager may not in fact be able to save the session for whatever reason; this is not an error. Caller cannot assume that calling save followed immediately by load_from_* will result in a successful lookup.
session | to save |
Implements Botan::TLS::Session_Manager.
Definition at line 172 of file tls_session_manager_sql.cpp.
References Botan::TLS::Session::encrypt(), Botan::hex_encode(), Botan::TLS::Server_Information::hostname(), Botan::TLS::Server_Information::port(), Botan::TLS::Session::server_info(), Botan::TLS::Session::session_id(), and Botan::TLS::Session::start_time().
|
inlineoverridevirtualinherited |
Return the allowed lifetime of a session; beyond this time, sessions are not resumed. Returns 0 if unknown/no explicit expiration policy.
Implements Botan::TLS::Session_Manager.
Definition at line 64 of file tls_session_manager_sql.h.