From f61b8ece49d403a73855c88b51e2e45d1faa70b4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 19 May 2006 00:09:21 +0000 Subject: Update some of the examples to reflect the new APIs. --- doc/examples/x509info.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'doc/examples/x509info.cpp') diff --git a/doc/examples/x509info.cpp b/doc/examples/x509info.cpp index cbb9c0a11..87ffcc30f 100644 --- a/doc/examples/x509info.cpp +++ b/doc/examples/x509info.cpp @@ -13,6 +13,8 @@ using namespace Botan; #include +#include +#include std::string to_hex(const SecureVector& bin) { @@ -24,14 +26,20 @@ std::string to_hex(const SecureVector& bin) return "(none)"; } -void do_print(const std::string& what, const std::string& val) +void do_print(const std::string& what, const std::string& vals) + // const std::vector& vals) { - if(val == "") + if(vals.size() == 0) return; - std::cout << " " << what << ": " << val << std::endl; + std::cout << " " << what << ": "; + std::cout << vals; + //std::copy(vals.begin(), vals.end(), + // std::ostream_iterator(std::cout, " ")); + std::cout << "\n"; } + void do_subject(const X509_Certificate& cert, const std::string& what) { do_print(what, cert.subject_info(what)); @@ -103,20 +111,20 @@ int main(int argc, char* argv[]) std::cout << " CRL Sign\n"; } - std::vector policies = cert.policies(); + std::vector policies = cert.policies(); if(policies.size()) { std::cout << "Policies: " << std::endl; for(u32bit j = 0; j != policies.size(); j++) - std::cout << " " << OIDS::lookup(policies[j]) << std::endl; + std::cout << " " << policies[j] << std::endl; } - std::vector ex_constraints = cert.ex_constraints(); + std::vector ex_constraints = cert.ex_constraints(); if(ex_constraints.size()) { std::cout << "Extended Constraints: " << std::endl; for(u32bit j = 0; j != ex_constraints.size(); j++) - std::cout << " " << OIDS::lookup(ex_constraints[j]) << std::endl; + std::cout << " " << ex_constraints[j] << std::endl; } std::cout << "Signature algorithm: " << -- cgit v1.2.3