From ff380dedf10007a1bc0f4b7b874a9424bc6e1e4a Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 31 Dec 2013 18:32:43 +0000 Subject: Compile fix --- doc/examples/ocsp.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'doc/examples') diff --git a/doc/examples/ocsp.cpp b/doc/examples/ocsp.cpp index 4d0c34b25..81cfa198b 100644 --- a/doc/examples/ocsp.cpp +++ b/doc/examples/ocsp.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -9,15 +10,20 @@ using namespace Botan; int main(int argc, char* argv[]) { + if(argc != 2) + std::cout << "Usage: ocsp subject.pem issuer.pem"; + X509_Certificate subject(argv[1]); X509_Certificate issuer(argv[2]); Certificate_Store_In_Memory cas; cas.add_certificate(issuer); - OCSP::Response resp = OCSP::online_check(issuer, subject, cas); + OCSP::Response resp = OCSP::online_check(issuer, subject, &cas); + + auto status = resp.status_for(issuer, subject); - if(resp.affirmative_response_for(issuer, subject)) + if(status == Certificate_Status_Code::VERIFIED) std::cout << "OCSP check OK\n"; else - std::cout << "OCSP check failed\n"; + std::cout << "OCSP check failed " << Path_Validation_Result::status_string(status) << "\n"; } -- cgit v1.2.3