diff options
Diffstat (limited to 'src/cli/x509print.cpp')
-rw-r--r-- | src/cli/x509print.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/cli/x509print.cpp b/src/cli/x509print.cpp new file mode 100644 index 000000000..e583c91c2 --- /dev/null +++ b/src/cli/x509print.cpp @@ -0,0 +1,32 @@ +/* +* (C) 2014 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) +#include <botan/x509cert.h> + +namespace { + +int x509print(const std::vector<std::string> &args) + { + if(args.size() != 1) + { + std::cout << "Usage: " << args[0] << " cert.pem" << std::endl; + return 1; + } + + X509_Certificate cert(args[1]); + + std::cout << cert.to_string() << std::endl; + + return 0; + } + +REGISTER_APP(x509print); + +} + +#endif |