Botan 3.5.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 Botan::ASN1_Object::encode_into().

Referenced by Botan::PSS_Params::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(), 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 75 of file ocsp_types.cpp.

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

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 71 of file ocsp_types.cpp.

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

◆ 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: