From fc62f7f284387a180e42402e8706965a666efba7 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 8 Apr 2011 14:57:49 +0000 Subject: More pubkey doc updates --- doc/examples/x509info.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/examples/x509info.cpp (limited to 'doc/examples/x509info.cpp') diff --git a/doc/examples/x509info.cpp b/doc/examples/x509info.cpp new file mode 100644 index 000000000..b22b4ebd8 --- /dev/null +++ b/doc/examples/x509info.cpp @@ -0,0 +1,35 @@ +/* +* Read an X.509 certificate, and print various things about it +* (C) 2003 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#include +#include +using namespace Botan; + +#include + +int main(int argc, char* argv[]) + { + if(argc != 2) + { + std::cout << "Usage: " << argv[0] << " \n"; + return 1; + } + + Botan::LibraryInitializer init; + + try { + X509_Certificate cert(argv[1]); + + std::cout << cert.to_string(); + } + catch(std::exception& e) + { + std::cout << e.what() << std::endl; + return 1; + } + return 0; + } -- cgit v1.2.3