Botan
1.10.9
|
#include <libstate.h>
Public Member Functions | |
void | add_alias (const std::string &key, const std::string &value) |
void | add_allocator (Allocator *alloc) |
Algorithm_Factory & | algorithm_factory () const |
std::string | deref_alias (const std::string &alias) const |
std::string | get (const std::string §ion, const std::string &key) const |
Allocator * | get_allocator (const std::string &name="") const |
Mutex * | get_mutex () const |
RandomNumberGenerator & | global_rng () |
void | initialize (bool thread_safe) |
bool | is_set (const std::string §ion, const std::string &key) const |
Library_State () | |
void | set (const std::string §ion, const std::string &key, const std::string &value, bool overwrite=true) |
void | set_default_allocator (const std::string &name) |
~Library_State () | |
Global state container aka the buritto at the center of it all
Definition at line 27 of file libstate.h.
Botan::Library_State::Library_State | ( | ) |
Definition at line 266 of file libstate.cpp.
Botan::Library_State::~Library_State | ( | ) |
Definition at line 280 of file libstate.cpp.
void Botan::Library_State::add_alias | ( | const std::string & | key, |
const std::string & | value | ||
) |
Add a parameter value to the "alias" section.
key | the name of the parameter which shall have a new alias |
value | the new alias |
Definition at line 154 of file libstate.cpp.
References set().
void Botan::Library_State::add_allocator | ( | Allocator * | alloc | ) |
Add a new allocator to the list of available ones
alloc | the allocator to add |
Definition at line 87 of file libstate.cpp.
References Botan::Allocator::init(), and Botan::Allocator::type().
Referenced by initialize().
Algorithm_Factory & Botan::Library_State::algorithm_factory | ( | ) | const |
Definition at line 173 of file libstate.cpp.
Referenced by Botan::block_size_of(), Botan::get_block_cipher(), Botan::get_cipher(), Botan::get_eme(), Botan::get_emsa(), Botan::get_hash(), Botan::get_kdf(), Botan::get_mac(), Botan::get_pbe(), Botan::get_pbkdf(), Botan::get_stream_cipher(), global_rng(), Botan::Hash_Filter::Hash_Filter(), Botan::have_algorithm(), Botan::have_block_cipher(), Botan::have_hash(), Botan::have_mac(), Botan::have_stream_cipher(), initialize(), Botan::keylength_multiple_of(), Botan::MAC_Filter::MAC_Filter(), Botan::max_keylength_of(), Botan::min_keylength_of(), Botan::output_length_of(), Botan::retrieve_block_cipher(), Botan::retrieve_hash(), Botan::retrieve_mac(), Botan::retrieve_stream_cipher(), Botan::Record_Writer::set_keys(), Botan::Record_Reader::set_keys(), and Botan::StreamCipher_Filter::StreamCipher_Filter().
std::string Botan::Library_State::deref_alias | ( | const std::string & | alias | ) | const |
Resolve an alias.
alias | the alias to resolve. |
Definition at line 162 of file libstate.cpp.
References is_set().
Referenced by Botan::get_pbe(), and Botan::SCAN_Name::SCAN_Name().
std::string Botan::Library_State::get | ( | const std::string & | section, |
const std::string & | key | ||
) | const |
Get a parameter value as std::string.
section | the section of the desired key |
key | the desired keys name |
Definition at line 114 of file libstate.cpp.
Referenced by Botan::DL_Group::DL_Group(), Botan::EC_Group::EC_Group(), and Botan::OIDS::lookup().
Allocator * Botan::Library_State::get_allocator | ( | const std::string & | name = "" | ) | const |
name | the name of the allocator |
Definition at line 67 of file libstate.cpp.
Referenced by Botan::Allocator::get().
Mutex * Botan::Library_State::get_mutex | ( | ) | const |
Definition at line 59 of file libstate.cpp.
References Botan::Mutex_Factory::make().
Referenced by initialize().
RandomNumberGenerator & Botan::Library_State::global_rng | ( | ) |
Definition at line 183 of file libstate.cpp.
References algorithm_factory().
Referenced by Botan::AutoSeeded_RNG::AutoSeeded_RNG().
void Botan::Library_State::initialize | ( | bool | thread_safe | ) |
thread_safe | should a mutex be used for serialization |
Definition at line 197 of file libstate.cpp.
References add_allocator(), Botan::Algorithm_Factory::add_engine(), algorithm_factory(), Botan::confirm_startup_self_tests(), get_mutex(), Botan::has_mlock(), and Botan::CPUID::initialize().
Referenced by Botan::Global_State_Management::global_state(), and Botan::LibraryInitializer::initialize().
bool Botan::Library_State::is_set | ( | const std::string & | section, |
const std::string & | key | ||
) | const |
Check whether a certain parameter is set or not.
section | the section of the desired key |
key | the desired keys name |
Definition at line 126 of file libstate.cpp.
Referenced by deref_alias(), and Botan::OIDS::have_oid().
void Botan::Library_State::set | ( | const std::string & | section, |
const std::string & | key, | ||
const std::string & | value, | ||
bool | overwrite = true |
||
) |
Set a configuration parameter.
section | the section of the desired key |
key | the desired keys name |
value | the new value |
overwrite | if set to true, the parameters value will be overwritten even if it is already set, otherwise no existing values will be overwritten. |
Definition at line 137 of file libstate.cpp.
Referenced by add_alias(), and Botan::OIDS::add_oid().
void Botan::Library_State::set_default_allocator | ( | const std::string & | name | ) |
Set the default allocator
name | the name of the allocator to use as the default |
Definition at line 100 of file libstate.cpp.