Botan 3.6.1
Crypto and TLS for C&
Botan::Attribute Class Referencefinal

#include <pkix_types.h>

Inheritance diagram for Botan::Attribute:
Botan::ASN1_Object

Public Member Functions

 Attribute ()=default
 
 Attribute (const OID &oid, const std::vector< uint8_t > &params)
 
 Attribute (std::string_view oid_str, const std::vector< uint8_t > &params)
 
std::vector< uint8_t > BER_encode () const
 
void decode_from (BER_Decoder &from) override
 
void encode_into (DER_Encoder &to) const override
 
const std::vector< uint8_t > & get_parameters () const
 
const OIDobject_identifier () const
 
const OIDoid () const
 
const std::vector< uint8_t > & parameters () const
 

Detailed Description

Attribute

Definition at line 219 of file pkix_types.h.

Constructor & Destructor Documentation

◆ Attribute() [1/3]

Botan::Attribute::Attribute ( )
default

◆ Attribute() [2/3]

Botan::Attribute::Attribute ( const OID & oid,
const std::vector< uint8_t > & params )

Definition at line 18 of file x509_attribute.cpp.

18 :
19 m_oid(attr_oid), m_parameters(attr_value) {}

◆ Attribute() [3/3]

Botan::Attribute::Attribute ( std::string_view oid_str,
const std::vector< uint8_t > & params )

Definition at line 24 of file x509_attribute.cpp.

24 :
25 m_oid(OID::from_string(attr_oid)), m_parameters(attr_value) {}
static OID from_string(std::string_view str)
Definition asn1_oid.cpp:86

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().

◆ decode_from()

void Botan::Attribute::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 37 of file x509_attribute.cpp.

37 {
38 codec.start_sequence().decode(m_oid).start_set().raw_bytes(m_parameters).end_cons().end_cons();
39}

References Botan::BER_Decoder::decode(), Botan::BER_Decoder::end_cons(), Botan::BER_Decoder::raw_bytes(), Botan::BER_Decoder::start_sequence(), and Botan::BER_Decoder::start_set().

◆ encode_into()

void Botan::Attribute::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 30 of file x509_attribute.cpp.

30 {
31 codec.start_sequence().encode(m_oid).start_set().raw_bytes(m_parameters).end_cons().end_cons();
32}

References Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::raw_bytes(), Botan::DER_Encoder::start_sequence(), and Botan::DER_Encoder::start_set().

◆ get_parameters()

const std::vector< uint8_t > & Botan::Attribute::get_parameters ( ) const
inline

Definition at line 234 of file pkix_types.h.

234{ return m_parameters; }

◆ object_identifier()

const OID & Botan::Attribute::object_identifier ( ) const
inline

Definition at line 232 of file pkix_types.h.

232{ return m_oid; }

◆ oid()

const OID & Botan::Attribute::oid ( ) const
inline

Definition at line 228 of file pkix_types.h.

228{ return m_oid; }

◆ parameters()

const std::vector< uint8_t > & Botan::Attribute::parameters ( ) const
inline

Definition at line 230 of file pkix_types.h.

230{ return m_parameters; }

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