|
Botan 3.11.0
Crypto and TLS for C&
|
#include <dyn_load.h>
Public Member Functions | |
| Dynamically_Loaded_Library (const Dynamically_Loaded_Library &)=delete | |
| Dynamically_Loaded_Library (Dynamically_Loaded_Library &&)=default | |
| Dynamically_Loaded_Library (std::string_view lib_name) | |
| Dynamically_Loaded_Library & | operator= (const Dynamically_Loaded_Library &)=delete |
| Dynamically_Loaded_Library & | operator= (Dynamically_Loaded_Library &&)=default |
| template<typename PtrT> requires (std::is_pointer_v<PtrT>) | |
| PtrT | resolve (const std::string &symbol) const |
| void * | resolve_symbol (const std::string &symbol) const |
| template<typename PtrT> requires (std::is_pointer_v<PtrT>) | |
| std::optional< PtrT > | try_resolve_symbol (const std::string &symbol) const |
| ~Dynamically_Loaded_Library () | |
Represents a DLL or shared object
Definition at line 20 of file dyn_load.h.
|
explicit |
Load a DLL (or fail with an exception)
| lib_name | name or path to a library |
If you don't use a full path, the search order will be defined by whatever the system linker does by default. Always using fully qualified pathnames can help prevent code injection attacks (eg via manipulation of LD_LIBRARY_PATH on Linux)
Definition at line 64 of file dyn_load.cpp.
Referenced by Dynamically_Loaded_Library(), Dynamically_Loaded_Library(), operator=(), and operator=().
| Botan::Dynamically_Loaded_Library::~Dynamically_Loaded_Library | ( | ) |
Unload the DLL
Definition at line 67 of file dyn_load.cpp.
|
delete |
References Dynamically_Loaded_Library().
|
default |
References Dynamically_Loaded_Library().
|
delete |
References Dynamically_Loaded_Library().
|
default |
References Dynamically_Loaded_Library().
|
inline |
Convenience function for casting symbol to the right type
| symbol | names the symbol to load |
| Invalid_Argument | if the symbol is not found |
Definition at line 69 of file dyn_load.h.
References resolve_symbol().
Referenced by Botan::PKCS11::LowLevel::C_GetFunctionList().
| void * Botan::Dynamically_Loaded_Library::resolve_symbol | ( | const std::string & | symbol | ) | const |
Load a symbol (or fail with an exception)
| symbol | names the symbol to load |
| Invalid_Argument | if the symbol is not found |
Definition at line 75 of file dyn_load.cpp.
References Botan::fmt().
Referenced by resolve().
|
inline |
Try to load a symbol
| symbol | names the symbol to load |
Definition at line 47 of file dyn_load.h.
Referenced by Botan::PKCS11::LowLevel::C_GetInterface(), and Botan::PKCS11::LowLevel::C_GetInterfaceList().