diff options
author | lloyd <[email protected]> | 2009-12-16 22:54:39 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-12-16 22:54:39 +0000 |
commit | 1d595f8976483078c292e365bde3949c9de26332 (patch) | |
tree | 874f7cb1b2ba23405bc69330e6233eb567bf2ec4 /doc/examples/ca.cpp | |
parent | f3f36611db8c3f6c67c818d454973a0165b0fcf2 (diff) | |
parent | 85b961ff87c1d6300451538c939c99a2ff74b505 (diff) |
propagate from branch 'net.randombit.botan' (head 22c82e10d78ad0e2cdaa56cb02f3d846ed0ead5e)
to branch 'net.randombit.botan.c++0x' (head 74dbf310b7fcc11f94a16cd63046219acd5d62bc)
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 f5eccdde9..8ca6228c2 100644 --- a/doc/examples/ca.cpp +++ b/doc/examples/ca.cpp @@ -15,11 +15,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[]) { @@ -56,8 +56,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); |