Botan  1.11.15
Public Types | Public Member Functions | Public Attributes
Botan::AlgorithmIdentifier Class Reference

#include <alg_id.h>

Inheritance diagram for Botan::AlgorithmIdentifier:
Botan::ASN1_Object

List of all members.

Public Types

enum  Encoding_Option { USE_NULL_PARAM }

Public Member Functions

 AlgorithmIdentifier ()
 AlgorithmIdentifier (const OID &, Encoding_Option)
 AlgorithmIdentifier (const std::string &, Encoding_Option)
 AlgorithmIdentifier (const OID &, const std::vector< byte > &)
 AlgorithmIdentifier (const std::string &, const std::vector< byte > &)
void decode_from (class BER_Decoder &)
void encode_into (class DER_Encoder &) const

Public Attributes

OID oid
std::vector< byteparameters

Detailed Description

Algorithm Identifier

Definition at line 20 of file alg_id.h.


Member Enumeration Documentation

Enumerator:
USE_NULL_PARAM 

Definition at line 23 of file alg_id.h.


Constructor & Destructor Documentation

Definition at line 28 of file alg_id.h.

{}

Definition at line 38 of file alg_id.cpp.

References oid, parameters, and USE_NULL_PARAM.

   {
   const byte DER_NULL[] = { 0x05, 0x00 };

   oid = alg_id;

   if(option == USE_NULL_PARAM)
      parameters += std::pair<const byte*, size_t>(DER_NULL, sizeof(DER_NULL));
   }
Botan::AlgorithmIdentifier::AlgorithmIdentifier ( const std::string &  alg_id,
Encoding_Option  option 
)

Definition at line 52 of file alg_id.cpp.

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

   {
   const byte DER_NULL[] = { 0x05, 0x00 };

   oid = OIDS::lookup(alg_id);

   if(option == USE_NULL_PARAM)
      parameters += std::pair<const byte*, size_t>(DER_NULL, sizeof(DER_NULL));
   }
Botan::AlgorithmIdentifier::AlgorithmIdentifier ( const OID alg_id,
const std::vector< byte > &  param 
)

Definition at line 18 of file alg_id.cpp.

References oid, and parameters.

   {
   oid = alg_id;
   parameters = param;
   }
Botan::AlgorithmIdentifier::AlgorithmIdentifier ( const std::string &  alg_id,
const std::vector< byte > &  param 
)

Definition at line 28 of file alg_id.cpp.

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

   {
   oid = OIDS::lookup(alg_id);
   parameters = param;
   }

Member Function Documentation

void Botan::AlgorithmIdentifier::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 97 of file alg_id.cpp.

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

   {
   codec.start_cons(SEQUENCE)
      .decode(oid)
      .raw_bytes(parameters)
   .end_cons();
   }
void Botan::AlgorithmIdentifier::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 86 of file alg_id.cpp.

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

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

Member Data Documentation


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