aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/gen_certs.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-08-13 15:13:21 +0000
committerlloyd <[email protected]>2010-08-13 15:13:21 +0000
commit3da3b04e1ba1577b3d0e1b4b9b3f4b24381fc433 (patch)
tree8a4b3a3b8e830ffcbd41f41859db4ab4fd972fb2 /doc/examples/gen_certs.cpp
parent2cae6ec17984ad016f973d5925860278e575b3f4 (diff)
parent789cee0888bbede838a2a3cf6221677c9f172872 (diff)
propagate from branch 'net.randombit.botan' (head 0a3348f52bf558bc2282e1066c2913a72a1aeda5)
to branch 'net.randombit.botan.c++0x' (head 552c20ae8874f12da779fc25ea368e36e71cbfe8)
Diffstat (limited to 'doc/examples/gen_certs.cpp')
-rw-r--r--doc/examples/gen_certs.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/doc/examples/gen_certs.cpp b/doc/examples/gen_certs.cpp
index f8c9fe124..73d667edb 100644
--- a/doc/examples/gen_certs.cpp
+++ b/doc/examples/gen_certs.cpp
@@ -11,9 +11,9 @@
#include <botan/botan.h>
#include <botan/rsa.h>
-#include <botan/time.h>
#include <botan/x509self.h>
#include <botan/x509_ca.h>
+#include <chrono>
using namespace Botan;
@@ -79,16 +79,14 @@ void save_pair(const std::string& name,
key_out.close();
}
-}
+typedef std::chrono::duration<int, std::ratio<31556926>> years;
int main()
{
- const u32bit seconds_in_a_year = 31556926;
-
- const u32bit current_time = system_time();
+ auto current_time = std::chrono::system_clock::now();
X509_Time now = X509_Time(current_time);
- X509_Time later = X509_Time(current_time + 4*seconds_in_a_year);
+ X509_Time later = X509_Time(current_time + years(4));
LibraryInitializer init;