Botan 2.13.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 > &)
std::vector< uint8_t > | BER_encode () const
void | decode_from (class BER_Decoder &from) override
void | encode_into (class DER_Encoder &to) const override
const OID & | get_oid () const
const std::vector< uint8_t > & | get_parameters () const

## Public Attributes
BOTAN_DEPRECATED_PUBLIC_MEMBER_VARIABLES | __pad0__: 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 :
19 oid(attr_oid),
20 parameters(attr_value)
21 {}
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:40

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

Definition at line 26 of file asn1_attribute.cpp.

27 :
28 oid(OID::from_string(attr_oid)),
29 parameters(attr_value)
30 {}
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:40
Botan::OID::from_string
static OID from_string(const std::string &str)
Definition: asn1_oid.cpp:62

## Member Function Documentation

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 16 of file asn1_obj.cpp.

References Botan::ASN1_Object::encode_into().

Referenced by Botan::PSSR::config_for_x509(), 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().

17 {
18 std::vector<uint8_t> output;
19 DER_Encoder der(output);
20 this->encode_into(der);
21 return output;
22 }
Botan::ASN1_Object::encode_into
virtual void encode_into(DER_Encoder &to) const =0

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 48 of file asn1_attribute.cpp.

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

49 {
50 codec.start_cons(SEQUENCE)
51 .decode(oid)
52 .start_cons(SET)
53 .raw_bytes(parameters)
54 .end_cons()
55 .end_cons();
56 }
Botan::SEQUENCE
Definition: asn1_obj.h:40
Botan::SET
Definition: asn1_obj.h:41
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.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 35 of file asn1_attribute.cpp.

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

36 {
37 codec.start_cons(SEQUENCE)
38 .encode(oid)
39 .start_cons(SET)
40 .raw_bytes(parameters)
41 .end_cons()
42 .end_cons();
43 }
Botan::SEQUENCE
Definition: asn1_obj.h:40
Botan::SET
Definition: asn1_obj.h:41
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:40

const OID& Botan::Attribute::get_oid | ( |  | ) | const
| inline

Definition at line 30 of file asn1_attribute.h.

30 { return oid; }

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

Definition at line 32 of file asn1_attribute.h.

32 { return parameters; }
Botan::Attribute::parameters
std::vector< uint8_t > parameters
Definition: asn1_attribute.h:40

## Member Data Documentation

BOTAN_DEPRECATED_PUBLIC_MEMBER_VARIABLES Botan::Attribute::__pad0__

Definition at line 39 of file asn1_attribute.h.

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

Definition at line 40 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