14 #include <botan/exceptn.h> 15 #include <botan/version.h> 16 #include <botan/auto_rng.h> 19 namespace cryptolink {
26 CryptoLink::~CryptoLink() {
33 rng.reset(
new Botan::AutoSeeded_RNG());
40 std::vector<uint8_t>
random(
size_t len) {
41 std::vector<uint8_t> data;
45 rng->randomize(&data[0], len);
46 }
catch (
const Botan::Exception& ex) {
48 "Botan error: " << ex.
what());
54 boost::shared_ptr<Botan::RandomNumberGenerator> rng;
62 }
catch (
const Botan::Exception& ex) {
69 }
catch (
const Botan::Exception& ex) {
74 atexit([]{ getCryptoLink().getRNG().reset(); });
79 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.
Singleton entry point and factory class.
Defines the logger used by the top-level component of kea-lfc.
std::vector< uint8_t > random(size_t len)
Generate random value.
This exception is thrown if there was a problem initializing the crypto library.
Botan implementation of RNG.
static std::string getVersion()
Get version string.