14 #include <botan/exceptn.h>
15 #include <botan/version.h>
16 #include <botan/auto_rng.h>
19 namespace cryptolink {
22 class CryptoLinkImpl {
26 CryptoLink::~CryptoLink() {
31 class RNGImpl :
public RNG {
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;
60 CryptoLink& c = getCryptoLinkInternal();
63 c.impl_ =
new CryptoLinkImpl();
64 }
catch (
const Botan::Exception& ex) {
65 isc_throw(InitializationError,
"Botan error: " << ex.what());
70 c.rng_.reset(
new RNGImpl());
71 }
catch (
const Botan::Exception& ex) {
72 isc_throw(InitializationError,
"Botan error: " << ex.what());
81 return (Botan::version_string());