Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
Botan::Attribute Class Referencefinal

`#include <asn1_attribute.h>`

Inheritance diagram for Botan::Attribute:

## Public Member Functions
| Attribute ()=default
| Attribute (const OID &, const std::vector< uint8_t > &)
| Attribute (const std::string &, const std::vector< uint8_t > &)
void | decode_from (class BER_Decoder &from) override
void | encode_into (class DER_Encoder &to) const override

## Public Attributes
OID | oid
std::vector< uint8_t > | parameters

## Detailed Description

Attribute

Definition at line 20 of file asn1_attribute.h.

## Constructor & Destructor Documentation

Botan::Attribute::Attribute | ( |  | ) |
| default

Botan::Attribute::Attribute | ( | const OID & | attr_oid,
|  | const std::vector< uint8_t > & | attr_value
| ) |  |

Definition at line 18 of file asn1_attribute.cpp.

18 : oid(attr_oid), parameters(attr_value)
19 {}
Botan::Attribute::oid
OID oid
Definition: asn1_attribute.h:27
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:30

Botan::Attribute::Attribute | ( | const std::string & | attr_oid,
|  | const std::vector< uint8_t > & | attr_value
| ) |  |

Definition at line 24 of file asn1_attribute.cpp.

25 : oid(OIDS::lookup(attr_oid)), parameters(attr_value)
26 {}
Botan::Attribute::oid
OID oid
Definition: asn1_attribute.h:27
Botan::OIDS::lookup
std::string lookup(const OID &oid)
Definition: oids.cpp:18
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:30

## Member Function Documentation

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

Decode whatever this object is from from

Parameters

  from | the BER_Decoder that will be read from

Implements Botan::ASN1_Object.

Definition at line 44 of file asn1_attribute.cpp.

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

45 {
46 codec.start_cons(SEQUENCE)
47 .decode(oid)
48 .start_cons(SET)
49 .raw_bytes(parameters)
50 .end_cons()
51 .end_cons();
52 }
Botan::Attribute::oid
OID oid
Definition: asn1_attribute.h:27
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:30
Botan::SEQUENCE
Definition: asn1_obj.h:39
Botan::SET
Definition: asn1_obj.h:40

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

Encode whatever this object is into to

Parameters

  to | the DER_Encoder that will be written to

Implements Botan::ASN1_Object.

Definition at line 31 of file asn1_attribute.cpp.

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

32 {
33 codec.start_cons(SEQUENCE)
34 .encode(oid)
35 .start_cons(SET)
36 .raw_bytes(parameters)
37 .end_cons()
38 .end_cons();
39 }
Botan::Attribute::oid
OID oid
Definition: asn1_attribute.h:27
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:30
Botan::SEQUENCE
Definition: asn1_obj.h:39
Botan::SET
Definition: asn1_obj.h:40

## Member Data Documentation

OID Botan::Attribute::oid

Definition at line 27 of file asn1_attribute.h.

Referenced by decode_from(), and encode_into().

std::vector<uint8_t> Botan::Attribute::parameters

Definition at line 30 of file asn1_attribute.h.

Referenced by decode_from(), and encode_into().

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

- src/lib/asn1/asn1_attribute.h
- src/lib/asn1/asn1_attribute.cpp