aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/ca.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/ca.cpp')
-rw-r--r--doc/examples/ca.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/doc/examples/ca.cpp b/doc/examples/ca.cpp
index d0fd32d17..e4fb9eb02 100644
--- a/doc/examples/ca.cpp
+++ b/doc/examples/ca.cpp
@@ -14,7 +14,6 @@
*/
#include <botan/botan.h>
-#include <botan/rng.h>
#include <botan/x509_ca.h>
#include <botan/util.h>
using namespace Botan;
@@ -38,13 +37,12 @@ int main(int argc, char* argv[])
const std::string arg_ca_key = argv[3];
const std::string arg_req_file = argv[4];
- std::auto_ptr<RandomNumberGenerator> rng(
- RandomNumberGenerator::make_rng());
+ AutoSeeded_RNG rng;
X509_Certificate ca_cert(arg_ca_cert);
std::auto_ptr<PKCS8_PrivateKey> privkey(
- PKCS8::load_key(arg_ca_key, *rng, arg_passphrase)
+ PKCS8::load_key(arg_ca_key, rng, arg_passphrase)
);
X509_CA ca(ca_cert, *privkey);
@@ -59,7 +57,7 @@ int main(int argc, char* argv[])
X509_Time start_time(system_time());
X509_Time end_time(system_time() + 365 * 60 * 60 * 24);
- X509_Certificate new_cert = ca.sign_request(req, *rng,
+ X509_Certificate new_cert = ca.sign_request(req, rng,
start_time, end_time);
// send the new cert back to the requestor