Botan 3.14.1
Crypto and TLS for C&
tls_session_manager_sqlite.h
Go to the documentation of this file.
1/*
2* SQLite3 TLS Session Manager
3* (C) 2012 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_TLS_SQLITE3_SESSION_MANAGER_H_
9#define BOTAN_TLS_SQLITE3_SESSION_MANAGER_H_
10
11#include <botan/tls_session_manager_sql.h>
12
13namespace Botan {
14
16
17namespace TLS {
18
19/**
20* An implementation of Session_Manager that saves values in a SQLite3
21* database file, with the session data encrypted using a passphrase.
22*
23* @warning For clients, the hostnames associated with the saved
24* sessions are stored in the database in plaintext. This may be a
25* serious privacy risk in some situations.
26*/
28 public:
29 /**
30 * @param passphrase used to encrypt the session data
31 * @param rng a random number generator
32 * @param db_filename filename of the SQLite database file.
33 * The table names tls_sessions and tls_sessions_metadata
34 * will be used. A new file is created with the default
35 * permissions of the process, so it should be placed in a
36 * directory that is not accessible to other users.
37 * @param max_sessions the maximum number of sessions kept in the
38 * database; whenever a session is stored, the oldest sessions
39 * beyond this limit are permanently deleted. (If zero, don't cap)
40 */
41 Session_Manager_SQLite(std::string_view passphrase,
42 const std::shared_ptr<RandomNumberGenerator>& rng,
43 std::string_view db_filename,
44 size_t max_sessions = 1000);
45};
46
47} // namespace TLS
48
49} // namespace Botan
50
51#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
Session_Manager_SQL(std::shared_ptr< SQL_Database > db, std::string_view passphrase, const std::shared_ptr< RandomNumberGenerator > &rng, size_t max_sessions=1000)
Session_Manager_SQLite(std::string_view passphrase, const std::shared_ptr< RandomNumberGenerator > &rng, std::string_view db_filename, size_t max_sessions=1000)