14 #include <botan/botan.h> 15 #include <botan/init.h> 16 #include <botan/auto_rng.h> 19 namespace cryptolink {
24 Botan::LibraryInitializer botan_init_;
27 CryptoLink::~CryptoLink() {
36 rng.reset(
new Botan::AutoSeeded_RNG());
43 std::vector<uint8_t> random(
size_t len) {
44 std::vector<uint8_t> data;
48 rng->randomize(&data[0], len);
49 }
catch (
const Botan::Exception& ex) {
51 "Botan error: " << ex.
what());
57 boost::shared_ptr<Botan::RandomNumberGenerator> rng;
66 }
catch (
const Botan::Exception& ex) {
73 }
catch (
const Botan::Exception& ex) {
81 return (Botan::version_string());
This exception is raised when a general error that was not specifically caught is thrown by the under...
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
static void initialize()
Initialize the library manually.
Singleton entry point and factory class.
Defines the logger used by the top-level component of kea-dhcp-ddns.
This exception is thrown if there was a problem initializing the crypto library.
Botan implementation of RNG.
static std::string getVersion()
Get version string.