Botan 1.10.17
Botan::Attribute Class Reference

#include <asn1_obj.h>

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

Public Member Functions

 Attribute ()
 Attribute (const OID &, const MemoryRegion< byte > &)
 Attribute (const std::string &, const MemoryRegion< byte > &)
void decode_from (class BER_Decoder &from)
void encode_into (class DER_Encoder &to) const

Public Attributes

OID oid
MemoryVector< byteparameters

Detailed Description

Attribute

Definition at line 24 of file asn1_obj.h.

Constructor & Destructor Documentation

◆ Attribute() [1/3]

Botan::Attribute::Attribute ( )
inline

Definition at line 33 of file asn1_obj.h.

33{}

Referenced by Botan::X509::create_cert_req().

◆ Attribute() [2/3]

Botan::Attribute::Attribute ( const OID & attr_oid,
const MemoryRegion< byte > & attr_value )

Definition at line 18 of file asn1_att.cpp.

19 {
20 oid = attr_oid;
21 parameters = attr_value;
22 }
MemoryVector< byte > parameters
Definition asn1_obj.h:31

References oid, and parameters.

◆ Attribute() [3/3]

Botan::Attribute::Attribute ( const std::string & attr_oid,
const MemoryRegion< byte > & attr_value )

Definition at line 27 of file asn1_att.cpp.

29 {
30 oid = OIDS::lookup(attr_oid);
31 parameters = attr_value;
32 }
std::string lookup(const OID &oid)
Definition oids.cpp:31

References Botan::OIDS::lookup(), oid, and parameters.

Member Function Documentation

◆ decode_from()

void Botan::Attribute::decode_from ( class BER_Decoder & from)
virtual

Decode whatever this object is from from

Parameters
fromthe BER_Decoder that will be read from

Implements Botan::ASN1_Object.

Definition at line 50 of file asn1_att.cpp.

51 {
52 codec.start_cons(SEQUENCE)
53 .decode(oid)
54 .start_cons(SET)
55 .raw_bytes(parameters)
56 .end_cons()
57 .end_cons();
58 }
@ SEQUENCE
Definition asn1_int.h:35
@ SET
Definition asn1_int.h:36

References Botan::BER_Decoder::decode(), Botan::BER_Decoder::end_cons(), oid, parameters, Botan::BER_Decoder::raw_bytes(), Botan::SEQUENCE, Botan::SET, and Botan::BER_Decoder::start_cons().

◆ encode_into()

void Botan::Attribute::encode_into ( class DER_Encoder & to) const
virtual

Encode whatever this object is into to

Parameters
tothe DER_Encoder that will be written to

Implements Botan::ASN1_Object.

Definition at line 37 of file asn1_att.cpp.

38 {
39 codec.start_cons(SEQUENCE)
40 .encode(oid)
41 .start_cons(SET)
42 .raw_bytes(parameters)
43 .end_cons()
44 .end_cons();
45 }

References Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), oid, parameters, Botan::DER_Encoder::raw_bytes(), Botan::SEQUENCE, Botan::SET, and Botan::DER_Encoder::start_cons().

Member Data Documentation

◆ oid

OID Botan::Attribute::oid

Definition at line 30 of file asn1_obj.h.

Referenced by Attribute(), Attribute(), decode_from(), and encode_into().

◆ parameters

MemoryVector<byte> Botan::Attribute::parameters

Definition at line 31 of file asn1_obj.h.

Referenced by Attribute(), Attribute(), decode_from(), and encode_into().


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