14#include <botan/exceptn.h>
15#include <botan/version.h>
16#include <botan/auto_rng.h>
26CryptoLink::~CryptoLink() {
30class RNGImpl :
public RNG {
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;
58CryptoLink::initialize(CryptoLink& c) {
61 c.impl_.reset(
new CryptoLinkImpl());
62 }
catch (
const Botan::Exception& ex) {
63 isc_throw(InitializationError,
"Botan error: " << ex.what());
68 c.rng_.reset(
new RNGImpl());
69 }
catch (
const Botan::Exception& ex) {
70 isc_throw(InitializationError,
"Botan error: " << ex.what());
77 return (Botan::version_string());
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
static std::string getVersion()
Get 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.
Defines the logger used by the top-level component of kea-lfc.