Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Public Attributes | List of all members
Botan::AlgorithmIdentifier Class Referencefinal

`#include <alg_id.h>`

Inheritance diagram for Botan::AlgorithmIdentifier:

## Public Types
enum | Encoding_Option { USE_NULL_PARAM }

## Public Member Functions
| AlgorithmIdentifier ()=default
| AlgorithmIdentifier (const OID &, Encoding_Option)
| AlgorithmIdentifier (const std::string &, Encoding_Option)
| AlgorithmIdentifier (const OID &, const std::vector< uint8_t > &)
| AlgorithmIdentifier (const std::string &, const std::vector< uint8_t > &)
void | decode_from (class BER_Decoder &) override
void | encode_into (class DER_Encoder &) const override

## Public Attributes
OID | oid
std::vector< uint8_t > | parameters

## Detailed Description

Algorithm Identifier

Definition at line 20 of file alg_id.h.

## Member Enumeration Documentation

enum Botan::AlgorithmIdentifier::Encoding_Option

Enumerator
USE_NULL_PARAM |

Definition at line 23 of file alg_id.h.

23 { USE_NULL_PARAM };
Botan::AlgorithmIdentifier::USE_NULL_PARAM
Definition: alg_id.h:23

## Constructor & Destructor Documentation

Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( |  | ) |
| default

Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | const OID & | alg_id,
|  | Encoding_Option | option
| ) |  |

Definition at line 32 of file alg_id.cpp.

References parameters, and USE_NULL_PARAM.

33 : oid(alg_id), parameters()
34 {
35 const uint8_t DER_NULL[] = { 0x05, 0x00 };
36
37 if(option == USE_NULL_PARAM)
38 parameters += std::pair<const uint8_t*, size_t>(DER_NULL, sizeof(DER_NULL));
39 }
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:39
Botan::AlgorithmIdentifier::oid
OID oid
Definition: alg_id.h:36
Botan::AlgorithmIdentifier::USE_NULL_PARAM
Definition: alg_id.h:23

Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | const std::string & | alg_id,
|  | Encoding_Option | option
| ) |  |

Definition at line 44 of file alg_id.cpp.

References parameters, and USE_NULL_PARAM.

45 : oid(OIDS::lookup(alg_id)), parameters()
46 {
47 const uint8_t DER_NULL[] = { 0x05, 0x00 };
48
49 if(option == USE_NULL_PARAM)
50 parameters += std::pair<const uint8_t*, size_t>(DER_NULL, sizeof(DER_NULL));
51 }
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:39
Botan::OIDS::lookup
std::string lookup(const OID &oid)
Definition: oids.cpp:18
Botan::AlgorithmIdentifier::oid
OID oid
Definition: alg_id.h:36
Botan::AlgorithmIdentifier::USE_NULL_PARAM
Definition: alg_id.h:23

Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | const OID & | alg_id,
|  | const std::vector< uint8_t > & | param
| ) |  |

Definition at line 18 of file alg_id.cpp.

19 : oid(alg_id), parameters(param)
20 {}
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:39
Botan::AlgorithmIdentifier::oid
OID oid
Definition: alg_id.h:36

Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | const std::string & | alg_id,
|  | const std::vector< uint8_t > & | param
| ) |  |

Definition at line 25 of file alg_id.cpp.

26 : oid(OIDS::lookup(alg_id)), parameters(param)
27 {}
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:39
Botan::OIDS::lookup
std::string lookup(const OID &oid)
Definition: oids.cpp:18
Botan::AlgorithmIdentifier::oid
OID oid
Definition: alg_id.h:36

## Member Function Documentation

void Botan::AlgorithmIdentifier::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 101 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().

102 {
103 codec.start_cons(SEQUENCE)
104 .decode(oid)
105 .raw_bytes(parameters)
106 .end_cons();
107 }
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:39
Botan::AlgorithmIdentifier::oid
OID oid
Definition: alg_id.h:36
Botan::SEQUENCE
Definition: asn1_obj.h:39

void Botan::AlgorithmIdentifier::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 90 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().

91 {
92 codec.start_cons(SEQUENCE)
93 .encode(oid)
94 .raw_bytes(parameters)
95 .end_cons();
96 }
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:39
Botan::AlgorithmIdentifier::oid
OID oid
Definition: alg_id.h:36
Botan::SEQUENCE
Definition: asn1_obj.h:39

## Member Data Documentation

OID Botan::AlgorithmIdentifier::oid

Definition at line 36 of file alg_id.h.

Referenced by Botan::X509_Object::check_signature(), Botan::choose_sig_format(), decode_from(), Botan::EC_PrivateKey::EC_PrivateKey(), encode_into(), Botan::X509_Object::hash_used_for_signature(), Botan::OCSP::CertID::is_id_for(), Botan::load_private_key(), Botan::load_public_key(), Botan::operator==(), Botan::pbes2_decrypt(), and Botan::OCSP::Response::verify_signature().

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

Definition at line 39 of file alg_id.h.

Referenced by AlgorithmIdentifier(), Botan::choose_sig_format(), decode_from(), Botan::DL_Scheme_PrivateKey::DL_Scheme_PrivateKey(), Botan::DL_Scheme_PublicKey::DL_Scheme_PublicKey(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::EC_PublicKey::EC_PublicKey(), encode_into(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::operator==(), and Botan::pbes2_decrypt().

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

- src/lib/asn1/alg_id.h
- src/lib/asn1/alg_id.cpp