Botan  1.11.15
src/lib/cert/x509/ocsp.h
Go to the documentation of this file.
00001 /*
00002 * OCSP
00003 * (C) 2012 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_OCSP_H__
00009 #define BOTAN_OCSP_H__
00010 
00011 #include <botan/cert_status.h>
00012 #include <botan/ocsp_types.h>
00013 
00014 namespace Botan {
00015 
00016 class Certificate_Store;
00017 
00018 namespace OCSP {
00019 
00020 class BOTAN_DLL Request
00021    {
00022    public:
00023       Request(const X509_Certificate& issuer_cert,
00024               const X509_Certificate& subject_cert) :
00025          m_issuer(issuer_cert),
00026          m_subject(subject_cert)
00027          {}
00028 
00029       std::vector<byte> BER_encode() const;
00030 
00031       std::string base64_encode() const;
00032 
00033       const X509_Certificate& issuer() const { return m_issuer; }
00034 
00035       const X509_Certificate& subject() const { return m_subject; }
00036    private:
00037       X509_Certificate m_issuer, m_subject;
00038    };
00039 
00040 class BOTAN_DLL Response
00041    {
00042    public:
00043       Response() {}
00044 
00045       Response(const Certificate_Store& trusted_roots,
00046                const std::vector<byte>& response);
00047 
00048       Certificate_Status_Code status_for(const X509_Certificate& issuer,
00049                                                const X509_Certificate& subject) const;
00050 
00051    private:
00052       std::vector<SingleResponse> m_responses;
00053    };
00054 
00055 BOTAN_DLL Response online_check(const X509_Certificate& issuer,
00056                                 const X509_Certificate& subject,
00057                                 const Certificate_Store* trusted_roots);
00058 
00059 }
00060 
00061 }
00062 
00063 #endif