aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/ca.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-08-04 12:50:23 +0000
committerlloyd <[email protected]>2010-08-04 12:50:23 +0000
commite19f1554004830e99872c13b8d5fa678b93d586a (patch)
tree51ebc37d2bda7ee4ad9d16f8e0408ac9dd844dd2 /doc/examples/ca.cpp
parent5d9eecf1646facfff9b20e9932894fce0d0ff39c (diff)
parent49ebca0d092bcb6a208604f7ac8d1b798f5170fc (diff)
propagate from branch 'net.randombit.botan' (head 717a9d103aa80e6d66c04e3a23cf173aadf56ceb)
to branch 'net.randombit.botan.c++0x' (head c9759e8ebc2f360696a11f2d00fc218d7a8bf744)
Diffstat (limited to 'doc/examples/ca.cpp')
-rw-r--r--doc/examples/ca.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/examples/ca.cpp b/doc/examples/ca.cpp
index 8dd3e981f..25a3b5a03 100644
--- a/doc/examples/ca.cpp
+++ b/doc/examples/ca.cpp
@@ -17,11 +17,11 @@
#include <botan/botan.h>
#include <botan/x509_ca.h>
-#include <botan/time.h>
using namespace Botan;
#include <iostream>
#include <memory>
+#include <chrono>
int main(int argc, char* argv[])
{
@@ -58,8 +58,13 @@ int main(int argc, char* argv[])
// (this example should be extended to show how)
// now sign the request
- X509_Time start_time(system_time());
- X509_Time end_time(system_time() + 365 * 60 * 60 * 24);
+ auto now = std::chrono::system_clock::now();
+
+ X509_Time start_time(now);
+
+ typedef std::chrono::duration<int, std::ratio<31556926>> years;
+
+ X509_Time end_time(now + years(1));
X509_Certificate new_cert = ca.sign_request(req, rng,
start_time, end_time);