Botan  1.10.9
Public Member Functions | Public Attributes | List of all members
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

Botan::Attribute::Attribute ( )
inline

Definition at line 33 of file asn1_obj.h.

33 {}
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  }
MemoryVector< byte > parameters
Definition: asn1_obj.h:31
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  }
MemoryVector< byte > parameters
Definition: asn1_obj.h:31
std::string lookup(const OID &oid)
Definition: oids.cpp:31

Member Function Documentation

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.

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  }
MemoryVector< byte > parameters
Definition: asn1_obj.h:31
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.

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  }
MemoryVector< byte > parameters
Definition: asn1_obj.h:31

Member Data Documentation

OID Botan::Attribute::oid

Definition at line 30 of file asn1_obj.h.

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

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: