diff options
author | lloyd <[email protected]> | 2011-06-13 17:06:08 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-06-13 17:06:08 +0000 |
commit | 5fcdf6953ed820a446862702311221c10ae0b91d (patch) | |
tree | 10354a54bb8ef5c8f9c6cdd9fa0142ab0037c635 /doc/examples/gen_certs.cpp | |
parent | b145e593616e83a4c124bba70d451ef0f03c5f3f (diff) | |
parent | 1a28f7ef6064041955e7a662c5e087bbea03b6ad (diff) |
propagate from branch 'net.randombit.botan' (head 150bd11dd8090559ee1e83394b8283bf93a018de)
to branch 'net.randombit.botan.c++0x' (head 7480693bb3f1e8a4e039a3e7ba3d9a7007f9730e)
Diffstat (limited to 'doc/examples/gen_certs.cpp')
-rw-r--r-- | doc/examples/gen_certs.cpp | 10 |
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; |