Botan 3.9.0
Crypto and TLS for C&
Botan::OCSP::SingleResponse Class Referencefinal

#include <ocsp.h>

Inheritance diagram for Botan::OCSP::SingleResponse:
Botan::ASN1_Object

Public Member Functions

std::vector< uint8_t > BER_encode () const
size_t cert_status () const
const CertIDcertid () const
void decode_from (BER_Decoder &from) override
void encode_into (DER_Encoder &to) const override
X509_Time next_update () const
X509_Time this_update () const

Detailed Description

Definition at line 46 of file ocsp.h.

Member Function Documentation

◆ BER_encode()

std::vector< uint8_t > Botan::ASN1_Object::BER_encode ( ) const
inherited

Return the encoding of this object. This is a convenience method when just one object needs to be serialized. Use DER_Encoder for complicated encodings.

Definition at line 19 of file asn1_obj.cpp.

19 {
20 std::vector<uint8_t> output;
21 DER_Encoder der(output);
22 this->encode_into(der);
23 return output;
24}
virtual void encode_into(DER_Encoder &to) const =0

References encode_into().

Referenced by decode_from(), Botan::Certificate_Store_In_SQL::find_all_certs(), Botan::Certificate_Store_In_SQL::find_cert(), Botan::X509_Certificate::fingerprint(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::X509_Object::PEM_encode(), Botan::PSS_Params::PSS_Params(), and Botan::Certificate_Store_In_SQL::revoke_cert().

◆ cert_status()

size_t Botan::OCSP::SingleResponse::cert_status ( ) const
inline

Definition at line 50 of file ocsp.h.

50{ return m_cert_status; }

Referenced by decode_from().

◆ certid()

const CertID & Botan::OCSP::SingleResponse::certid ( ) const
inline

Definition at line 48 of file ocsp.h.

48{ return m_certid; }

◆ decode_from()

void Botan::OCSP::SingleResponse::decode_from ( BER_Decoder & from)
overridevirtual

Decode whatever this object is from from

Parameters
fromthe BER_Decoder that will be read from

Implements Botan::ASN1_Object.

Definition at line 74 of file ocsp_types.cpp.

74 {
75 BER_Object cert_status;
76 Extensions extensions;
77
78 from.start_sequence()
79 .decode(m_certid)
80 .get_next(cert_status)
81 .decode(m_thisupdate)
82 .decode_optional(m_nextupdate, ASN1_Type(0), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
83 .decode_optional(extensions, ASN1_Type(1), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
84 .end_cons();
85
86 /* CertStatus ::= CHOICE {
87 good [0] IMPLICIT NULL,
88 revoked [1] IMPLICIT RevokedInfo,
89 unknown [2] IMPLICIT UnknownInfo }
90
91 RevokedInfo ::= SEQUENCE {
92 revocationTime GeneralizedTime,
93 revocationReason [0] EXPLICIT CRLReason OPTIONAL }
94
95 UnknownInfo ::= NULL
96
97 We should verify the expected body and decode the RevokedInfo
98 */
99 m_cert_status = static_cast<uint32_t>(cert_status.type());
100}
size_t cert_status() const
Definition ocsp.h:50
ASN1_Type
Definition asn1_obj.h:43

References cert_status(), Botan::Constructed, Botan::ContextSpecific, Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_optional(), Botan::BER_Decoder::end_cons(), Botan::BER_Decoder::get_next(), and Botan::BER_Decoder::start_sequence().

◆ encode_into()

void Botan::OCSP::SingleResponse::encode_into ( DER_Encoder & to) const
overridevirtual

Encode whatever this object is into to

Parameters
tothe DER_Encoder that will be written to

Implements Botan::ASN1_Object.

Definition at line 70 of file ocsp_types.cpp.

70 {
71 throw Not_Implemented("SingleResponse::encode_into");
72}

◆ next_update()

X509_Time Botan::OCSP::SingleResponse::next_update ( ) const
inline

Definition at line 54 of file ocsp.h.

54{ return m_nextupdate; }

◆ this_update()

X509_Time Botan::OCSP::SingleResponse::this_update ( ) const
inline

Definition at line 52 of file ocsp.h.

52{ return m_thisupdate; }

The documentation for this class was generated from the following files: