Botan 3.6.1
Crypto and TLS for C&
|
#include <ocsp.h>
Public Member Functions | |
const std::vector< X509_Certificate > & | certificates () const |
std::optional< Certificate_Status_Code > | dummy_status () const |
std::optional< X509_Certificate > | find_signing_certificate (const X509_Certificate &issuer_certificate, const Certificate_Store *trusted_ocsp_responders=nullptr) const |
const X509_Time & | produced_at () const |
const std::vector< uint8_t > & | raw_bits () const |
Response (Certificate_Status_Code status) | |
Response (const std::vector< uint8_t > &response_bits) | |
Response (const uint8_t response_bits[], size_t response_bits_len) | |
const std::vector< uint8_t > & | signer_key_hash () const |
const X509_DN & | signer_name () const |
Response_Status_Code | status () const |
Certificate_Status_Code | status_for (const X509_Certificate &issuer, const X509_Certificate &subject, std::chrono::system_clock::time_point ref_time=std::chrono::system_clock::now(), std::chrono::seconds max_age=std::chrono::seconds::zero()) const |
Certificate_Status_Code | verify_signature (const X509_Certificate &signing_certificate) const |
Botan::OCSP::Response::Response | ( | Certificate_Status_Code | status | ) |
|
inline |
Botan::OCSP::Response::Response | ( | const uint8_t | response_bits[], |
size_t | response_bits_len ) |
Parses an OCSP response.
response_bits | response bits received |
response_bits_len | length of response in bytes |
Definition at line 84 of file ocsp.cpp.
References Botan::BitString, Botan::Constructed, Botan::ContextSpecific, Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_and_check(), Botan::BER_Decoder::decode_list(), Botan::BER_Decoder::decode_optional(), Botan::BER_Decoder::decode_optional_string(), Botan::X509_DN::empty(), Botan::BER_Decoder::end_cons(), Botan::Enumerated, Botan::BER_Decoder::get_next_octet_string(), Botan::BER_Decoder::more_items(), Botan::OctetString, Botan::BER_Decoder::raw_bytes(), Botan::BER_Decoder::start_context_specific(), Botan::BER_Decoder::start_sequence(), Botan::OCSP::Successful, and Botan::Universal.
|
inline |
|
inline |
std::optional< X509_Certificate > Botan::OCSP::Response::find_signing_certificate | ( | const X509_Certificate & | issuer_certificate, |
const Certificate_Store * | trusted_ocsp_responders = nullptr ) const |
Find the certificate that signed this OCSP response from all possible candidates and taking the attached certificates into account.
issuer_certificate | is the issuer of the certificate in question |
trusted_ocsp_responders | optionally, a certificate store containing additionally trusted responder certificates |
Definition at line 183 of file ocsp.cpp.
References Botan::X509_DN::empty(), Botan::Certificate_Store::find_cert(), and Botan::Certificate_Store::find_cert_by_pubkey_sha1().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Certificate_Status_Code Botan::OCSP::Response::status_for | ( | const X509_Certificate & | issuer, |
const X509_Certificate & | subject, | ||
std::chrono::system_clock::time_point | ref_time = std::chrono::system_clock::now(), | ||
std::chrono::seconds | max_age = std::chrono::seconds::zero() ) const |
Searches the OCSP response for issuer and subject certificate.
issuer | issuer certificate |
subject | subject certificate |
ref_time | the reference time |
max_age | the maximum age the response should be considered valid if next_update is not set |
Definition at line 218 of file ocsp.cpp.
References Botan::CERT_IS_REVOKED, Botan::OCSP_BAD_STATUS, Botan::OCSP_CERT_NOT_LISTED, Botan::OCSP_HAS_EXPIRED, Botan::OCSP_IS_TOO_OLD, Botan::OCSP_NOT_YET_VALID, and Botan::OCSP_RESPONSE_GOOD.
Certificate_Status_Code Botan::OCSP::Response::verify_signature | ( | const X509_Certificate & | signing_certificate | ) | const |
Check signature of the OCSP response.
Note: It is the responsibility of the caller to verify that signing certificate is trustworthy and authorized to do so.
signing_certificate | the certificate that signed this response ( |
Definition at line 155 of file ocsp.cpp.
References Botan::X509_DN::empty(), Botan::OCSP_ISSUER_NOT_FOUND, Botan::OCSP_RESPONSE_INVALID, Botan::OCSP_SIGNATURE_ERROR, Botan::OCSP_SIGNATURE_OK, Botan::ASN1::put_in_sequence(), Botan::X509_Certificate::subject_public_key(), and Botan::PK_Verifier::verify_message().