14 #include <botan/exceptn.h>
15 #include <botan/version.h>
16 #include <botan/auto_rng.h>
19 namespace cryptolink {
26 CryptoLink::~CryptoLink() {
34 rng.reset(
new Botan::AutoSeeded_RNG());
41 std::vector<uint8_t> random(
size_t len) {
42 std::vector<uint8_t> data;
46 rng->randomize(&data[0], len);
47 }
catch (
const Botan::Exception& ex) {
49 "Botan error: " << ex.
what());
55 boost::shared_ptr<Botan::RandomNumberGenerator> rng;
64 }
catch (
const Botan::Exception& ex) {
71 }
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...
#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.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
static CryptoLink & getCryptoLink()
Returns a reference to the singleton instance.
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.
virtual RNGPtr & getRNG()
Get the global RNG.