diff options
author | lloyd <[email protected]> | 2014-01-01 23:41:07 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-01 23:41:07 +0000 |
commit | 1119da3d0f6f8edf3dfa39672a9900ee009c5619 (patch) | |
tree | 4deabe57f5107ddb8547392468cc417f21d3db48 /doc/examples/cert_verify.cpp | |
parent | 7323f3ff83ff2199b1090f9d5f729b08ccac3151 (diff) |
Moar
Diffstat (limited to 'doc/examples/cert_verify.cpp')
-rw-r--r-- | doc/examples/cert_verify.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/doc/examples/cert_verify.cpp b/doc/examples/cert_verify.cpp deleted file mode 100644 index d9b170ef0..000000000 --- a/doc/examples/cert_verify.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Simple example of a certificate validation -* (C) 2010 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#include <botan/botan.h> -#include <botan/x509cert.h> -#include <botan/x509path.h> -#include <iostream> - -using namespace Botan; - -int main(int argc, char* argv[]) - { - if(argc <= 2) - { - std::cout << "Usage: " << argv[0] << " subject.pem [CA certificates...]\n"; - return 1; - } - - LibraryInitializer init; - X509_Certificate subject_cert(argv[1]); - - Certificate_Store_In_Memory certs; - - for(size_t i = 2; argv[i]; ++i) - certs.add_certificate(X509_Certificate(argv[i])); - - Path_Validation_Restrictions restrictions; - - Path_Validation_Result result = - x509_path_validate(subject_cert, - restrictions, - certs); - - if(result.successful_validation()) - std::cout << "Certificate validated\n"; - else - std::cout << "Certificate did not validate - " << result.result_string() << "\n"; - - return 0; - } |