Botan 1.10.17

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

`#include <asn1_obj.h>`

Inheritance diagram for Botan::Attribute:

## 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< byte > | parameters

## 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 {}

## ◆ Attribute() [2/3]

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

Definition at line 18 of file asn1_att.cpp.

References oid, and parameters.

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

## ◆ 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.

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

29 {
30 oid = OIDS::lookup(attr_oid);
31 parameters = attr_value;
32 }
Botan::Attribute::parameters
MemoryVector< byte > parameters
Definition: asn1_obj.h:31
Botan::Attribute::oid
OID oid
Definition: asn1_obj.h:30
Botan::OIDS::lookup
std::string lookup(const OID &oid)
Definition: oids.cpp:31

## Member Function Documentation

## ◆ decode_from()

void Botan::Attribute::decode_from | ( | class BER_Decoder & | from | ) |
| 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 50 of file asn1_att.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().

51 {
52 codec.start_cons(SEQUENCE)
53 .decode(oid)
54 .start_cons(SET)
55 .raw_bytes(parameters)
56 .end_cons()
57 .end_cons();
58 }
Botan::Attribute::parameters
MemoryVector< byte > parameters
Definition: asn1_obj.h:31
Botan::Attribute::oid
OID oid
Definition: asn1_obj.h:30
Botan::SEQUENCE
Definition: asn1_int.h:35
Botan::SET
Definition: asn1_int.h:36

## ◆ encode_into()

void Botan::Attribute::encode_into | ( | class DER_Encoder & | to | ) | const
| 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 37 of file asn1_att.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().

38 {
39 codec.start_cons(SEQUENCE)
40 .encode(oid)
41 .start_cons(SET)
42 .raw_bytes(parameters)
43 .end_cons()
44 .end_cons();
45 }
Botan::Attribute::parameters
MemoryVector< byte > parameters
Definition: asn1_obj.h:31
Botan::Attribute::oid
OID oid
Definition: asn1_obj.h:30
Botan::SEQUENCE
Definition: asn1_int.h:35
Botan::SET
Definition: asn1_int.h:36

## Member Data Documentation

## ◆ oid

OID Botan::Attribute::oid

Definition at line 30 of file asn1_obj.h.

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

## ◆ parameters

MemoryVector<byte> Botan::Attribute::parameters

Definition at line 31 of file asn1_obj.h.

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

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

- src/asn1/asn1_obj.h
- src/asn1/asn1_att.cpp