Botan  1.11.15
Public Member Functions | Public Attributes
Botan::Attribute Class Reference

#include <asn1_attribute.h>

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

List of all members.

Public Member Functions

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

Public Attributes

OID oid
std::vector< byteparameters

Detailed Description

Attribute

Definition at line 20 of file asn1_attribute.h.


Constructor & Destructor Documentation

Definition at line 29 of file asn1_attribute.h.

{}
Botan::Attribute::Attribute ( const OID attr_oid,
const std::vector< byte > &  attr_value 
)

Definition at line 18 of file asn1_attribute.cpp.

References oid, and parameters.

   {
   oid = attr_oid;
   parameters = attr_value;
   }
Botan::Attribute::Attribute ( const std::string &  attr_oid,
const std::vector< byte > &  attr_value 
)

Definition at line 27 of file asn1_attribute.cpp.

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

   {
   oid = OIDS::lookup(attr_oid);
   parameters = attr_value;
   }

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

   {
   codec.start_cons(SEQUENCE)
      .decode(oid)
      .start_cons(SET)
         .raw_bytes(parameters)
      .end_cons()
   .end_cons();
   }
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_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().

   {
   codec.start_cons(SEQUENCE)
      .encode(oid)
      .start_cons(SET)
         .raw_bytes(parameters)
      .end_cons()
   .end_cons();
   }

Member Data Documentation

Definition at line 26 of file asn1_attribute.h.

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

Definition at line 27 of file asn1_attribute.h.

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


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