|
Botan 3.13.0
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 |
| BOTAN_FUTURE_EXPLICIT | Response (Certificate_Status_Code status) |
| BOTAN_FUTURE_EXPLICIT | Response (const std::vector< uint8_t > &response_bits) |
| Response (const uint8_t response_bits[], size_t response_bits_len) | |
| const std::vector< SingleResponse > & | responses () const |
| 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 |
| Certificate_Status_Code | verify_signature (const X509_Certificate &signing_certificate, const Path_Validation_Restrictions &restrictions) const |
Static Public Member Functions | |
| static Response | dummy_no_revocation_url_response () |
| static Response | dummy_server_not_available_response () |
| Botan::OCSP::Response::Response | ( | Certificate_Status_Code | status | ) |
Create a fake OCSP response from a given status code.
| status | the status code the check functions will return |
TODO(Botan4) make this constructor private
Definition at line 372 of file ocsp.cpp.
References status().
Referenced by dummy_no_revocation_url_response(), dummy_server_not_available_response(), and Response().
|
inline |
Parses an OCSP response.
| response_bits | response bits received |
Definition at line 186 of file ocsp.h.
References BOTAN_FUTURE_EXPLICIT, and Response().
| 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 375 of file ocsp.cpp.
References Botan::Constructed, Botan::ContextSpecific, Botan::Extensions::critical_extensions(), Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_and_check(), Botan::Extensions::decode_from(), Botan::BER_Decoder::decode_list(), Botan::BER_Decoder::decode_octet_aligned_bitstring(), Botan::BER_Decoder::decode_optional(), Botan::BER_Decoder::decode_optional_string(), Botan::BER_Decoder::Limits::DER(), Botan::BER_Decoder::end_cons(), Botan::Enumerated, Botan::OID::from_string(), Botan::BER_Decoder::get_next_object(), Botan::BER_Decoder::get_next_octet_string(), Botan::BER_Object::is_a(), Botan::BER_Decoder::more_items(), Botan::OCSP_Response, Botan::OctetString, Botan::BER_Decoder::raw_bytes(), Botan::BER_Decoder::start_context_specific(), Botan::BER_Decoder::start_sequence(), Botan::OCSP::Successful, Botan::Universal, and Botan::BER_Decoder::verify_end().
|
inline |
|
inlinestatic |
Return a fake OCSP response indicating there was no usable OCSP URL This is not normally useful for applications
Definition at line 304 of file ocsp.h.
References Botan::OCSP_NO_REVOCATION_URL, and Response().
|
inlinestatic |
Return a fake OCSP response indicating the server was not available This is not normally useful for applications
Definition at line 296 of file ocsp.h.
References Botan::OCSP_SERVER_NOT_AVAILABLE, and Response().
|
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 601 of file ocsp.cpp.
References Botan::Certificate_Store::find_cert(), and Botan::Certificate_Store::find_cert_by_pubkey_sha1().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 240 of file ocsp.h.
Referenced by Response().
| 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 637 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, Botan::OCSP_RESPONSE_GOOD, and Botan::OCSP_RESPONSE_INVALID.
| 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 550 of file ocsp.cpp.
References verify_signature().
Referenced by verify_signature().
| Certificate_Status_Code Botan::OCSP::Response::verify_signature | ( | const X509_Certificate & | signing_certificate, |
| const Path_Validation_Restrictions & | restrictions ) 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 ( |
| restrictions | on the signature validation |
Definition at line 556 of file ocsp.cpp.
References Botan::PK_Verifier::check_signature(), Botan::ASN1::der_sequence_header(), Botan::PK_Verifier::hash_function(), Botan::Path_Validation_Restrictions::minimum_key_strength(), Botan::OCSP_ISSUER_NOT_FOUND, Botan::OCSP_RESPONSE_INVALID, Botan::OCSP_SIGNATURE_ERROR, Botan::OCSP_SIGNATURE_OK, Botan::SIGNATURE_METHOD_TOO_WEAK, Botan::X509_Certificate::subject_public_key(), Botan::Path_Validation_Restrictions::trusted_hashes(), Botan::UNKNOWN_CRITICAL_EXTENSION, Botan::UNTRUSTED_HASH, and Botan::PK_Verifier::update().