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/ca.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/ca.cpp')
-rw-r--r-- | doc/examples/ca.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/examples/ca.cpp b/doc/examples/ca.cpp index 7a3e6daf9..6fd2eb15b 100644 --- a/doc/examples/ca.cpp +++ b/doc/examples/ca.cpp @@ -1,10 +1,10 @@ #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[]) { @@ -41,8 +41,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); |