aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/x509info.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-19 00:09:21 +0000
committerlloyd <[email protected]>2006-05-19 00:09:21 +0000
commitf61b8ece49d403a73855c88b51e2e45d1faa70b4 (patch)
tree733fbb1461753da5654cdcf66b5672aa21881e16 /doc/examples/x509info.cpp
parentf090e030be53e574fecbe7cf50edfb5fdacb53e1 (diff)
Update some of the examples to reflect the new APIs.
Diffstat (limited to 'doc/examples/x509info.cpp')
-rw-r--r--doc/examples/x509info.cpp22
1 files changed, 15 insertions, 7 deletions
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 <iostream>
+#include <iterator>
+#include <algorithm>
std::string to_hex(const SecureVector<byte>& bin)
{
@@ -24,14 +26,20 @@ std::string to_hex(const SecureVector<byte>& 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<std::string>& 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::string>(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<OID> policies = cert.policies();
+ std::vector<std::string> 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<OID> ex_constraints = cert.ex_constraints();
+ std::vector<std::string> 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: " <<