Botan
2.1.0
Crypto and TLS for C++11
|
#include <der_enc.h>
Public Member Functions | |
DER_Encoder & | add_object (ASN1_Tag type_tag, ASN1_Tag class_tag, const uint8_t rep[], size_t length) |
DER_Encoder & | add_object (ASN1_Tag type_tag, ASN1_Tag class_tag, const std::vector< uint8_t > &rep) |
DER_Encoder & | add_object (ASN1_Tag type_tag, ASN1_Tag class_tag, const secure_vector< uint8_t > &rep) |
DER_Encoder & | add_object (ASN1_Tag type_tag, ASN1_Tag class_tag, const std::string &str) |
DER_Encoder & | add_object (ASN1_Tag type_tag, ASN1_Tag class_tag, uint8_t val) |
DER_Encoder & | encode (bool b) |
DER_Encoder & | encode (size_t s) |
DER_Encoder & | encode (const BigInt &n) |
DER_Encoder & | encode (const secure_vector< uint8_t > &v, ASN1_Tag real_type) |
DER_Encoder & | encode (const std::vector< uint8_t > &v, ASN1_Tag real_type) |
DER_Encoder & | encode (const uint8_t val[], size_t len, ASN1_Tag real_type) |
DER_Encoder & | encode (bool b, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC) |
DER_Encoder & | encode (size_t s, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC) |
DER_Encoder & | encode (const BigInt &n, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC) |
DER_Encoder & | encode (const std::vector< uint8_t > &v, ASN1_Tag real_type, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC) |
DER_Encoder & | encode (const secure_vector< uint8_t > &v, ASN1_Tag real_type, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC) |
DER_Encoder & | encode (const uint8_t v[], size_t len, ASN1_Tag real_type, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC) |
DER_Encoder & | encode (const ASN1_Object &obj) |
DER_Encoder & | encode_if (bool pred, DER_Encoder &enc) |
DER_Encoder & | encode_if (bool pred, const ASN1_Object &obj) |
template<typename T > | |
DER_Encoder & | encode_list (const std::vector< T > &values) |
DER_Encoder & | encode_null () |
template<typename T > | |
DER_Encoder & | encode_optional (const T &value, const T &default_value) |
DER_Encoder & | end_cons () |
DER_Encoder & | end_explicit () |
secure_vector< uint8_t > | get_contents () |
std::vector< uint8_t > | get_contents_unlocked () |
DER_Encoder & | raw_bytes (const uint8_t val[], size_t len) |
DER_Encoder & | raw_bytes (const secure_vector< uint8_t > &val) |
DER_Encoder & | raw_bytes (const std::vector< uint8_t > &val) |
DER_Encoder & | start_cons (ASN1_Tag type_tag, ASN1_Tag class_tag=UNIVERSAL) |
DER_Encoder & | start_explicit (uint16_t type_tag) |
DER_Encoder & Botan::DER_Encoder::add_object | ( | ASN1_Tag | type_tag, |
ASN1_Tag | class_tag, | ||
const uint8_t | rep[], | ||
size_t | length | ||
) |
Definition at line 381 of file der_enc.cpp.
References raw_bytes().
Referenced by add_object(), encode(), Botan::ASN1_String::encode_into(), Botan::OID::encode_into(), Botan::X509_Time::encode_into(), and encode_null().
|
inline |
Definition at line 99 of file der_enc.h.
|
inline |
Definition at line 105 of file der_enc.h.
DER_Encoder & Botan::DER_Encoder::add_object | ( | ASN1_Tag | type_tag, |
ASN1_Tag | class_tag, | ||
const std::string & | str | ||
) |
Definition at line 395 of file der_enc.cpp.
References add_object().
DER_Encoder & Botan::DER_Encoder::add_object | ( | ASN1_Tag | type_tag, |
ASN1_Tag | class_tag, | ||
uint8_t | val | ||
) |
Definition at line 406 of file der_enc.cpp.
References add_object().
DER_Encoder & Botan::DER_Encoder::encode | ( | bool | b | ) |
Definition at line 216 of file der_enc.cpp.
References Botan::BOOLEAN, and Botan::UNIVERSAL.
Referenced by Botan::GOST_3410_PublicKey::algorithm_identifier(), Botan::OCSP::Request::BER_encode(), Botan::PKCS8::BER_encode(), Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), Botan::X509::create_cert_req(), Botan::EC_Group::DER_encode(), Botan::TLS::Session::DER_encode(), Botan::DL_Group::DER_encode(), encode(), encode_if(), Botan::Attribute::encode_into(), Botan::AlternativeName::encode_into(), Botan::AlgorithmIdentifier::encode_into(), Botan::OCSP::CertID::encode_into(), Botan::CRL_Entry::encode_into(), Botan::X509_Object::encode_into(), Botan::Extensions::encode_into(), Botan::X509_Object::make_signed(), Botan::Curve25519_PrivateKey::private_key_bits(), Botan::DL_Scheme_PrivateKey::private_key_bits(), Botan::McEliece_PrivateKey::private_key_bits(), Botan::EC_PrivateKey::private_key_bits(), Botan::RSA_PrivateKey::private_key_bits(), Botan::Private_Key::private_key_info(), Botan::DL_Scheme_PublicKey::public_key_bits(), Botan::Curve25519_PublicKey::public_key_bits(), Botan::McEliece_PublicKey::public_key_bits(), Botan::RSA_PublicKey::public_key_bits(), Botan::GOST_3410_PublicKey::public_key_bits(), Botan::TPM_PrivateKey::public_key_bits(), and Botan::Public_Key::subject_public_key().
DER_Encoder & Botan::DER_Encoder::encode | ( | size_t | s | ) |
Definition at line 224 of file der_enc.cpp.
References encode(), Botan::INTEGER, and Botan::UNIVERSAL.
DER_Encoder & Botan::DER_Encoder::encode | ( | const BigInt & | n | ) |
Definition at line 232 of file der_enc.cpp.
References encode(), Botan::INTEGER, and Botan::UNIVERSAL.
DER_Encoder & Botan::DER_Encoder::encode | ( | const secure_vector< uint8_t > & | v, |
ASN1_Tag | real_type | ||
) |
Definition at line 240 of file der_enc.cpp.
References encode(), and Botan::UNIVERSAL.
DER_Encoder & Botan::DER_Encoder::encode | ( | const std::vector< uint8_t > & | v, |
ASN1_Tag | real_type | ||
) |
Definition at line 250 of file der_enc.cpp.
References encode(), and Botan::UNIVERSAL.
DER_Encoder & Botan::DER_Encoder::encode | ( | const uint8_t | val[], |
size_t | len, | ||
ASN1_Tag | real_type | ||
) |
Definition at line 260 of file der_enc.cpp.
References encode(), and Botan::UNIVERSAL.
DER_Encoder & Botan::DER_Encoder::encode | ( | bool | b, |
ASN1_Tag | type_tag, | ||
ASN1_Tag | class_tag = CONTEXT_SPECIFIC |
||
) |
Definition at line 269 of file der_enc.cpp.
References add_object().
DER_Encoder & Botan::DER_Encoder::encode | ( | size_t | s, |
ASN1_Tag | type_tag, | ||
ASN1_Tag | class_tag = CONTEXT_SPECIFIC |
||
) |
DER_Encoder & Botan::DER_Encoder::encode | ( | const BigInt & | n, |
ASN1_Tag | type_tag, | ||
ASN1_Tag | class_tag = CONTEXT_SPECIFIC |
||
) |
Definition at line 288 of file der_enc.cpp.
References add_object(), Botan::BigInt::bits(), Botan::BigInt::bytes(), and Botan::BigInt::encode().
DER_Encoder & Botan::DER_Encoder::encode | ( | const std::vector< uint8_t > & | v, |
ASN1_Tag | real_type, | ||
ASN1_Tag | type_tag, | ||
ASN1_Tag | class_tag = CONTEXT_SPECIFIC |
||
) |
DER_Encoder & Botan::DER_Encoder::encode | ( | const secure_vector< uint8_t > & | v, |
ASN1_Tag | real_type, | ||
ASN1_Tag | type_tag, | ||
ASN1_Tag | class_tag = CONTEXT_SPECIFIC |
||
) |
DER_Encoder & Botan::DER_Encoder::encode | ( | const uint8_t | v[], |
size_t | len, | ||
ASN1_Tag | real_type, | ||
ASN1_Tag | type_tag, | ||
ASN1_Tag | class_tag = CONTEXT_SPECIFIC |
||
) |
Definition at line 334 of file der_enc.cpp.
References add_object(), Botan::BIT_STRING, and Botan::OCTET_STRING.
DER_Encoder & Botan::DER_Encoder::encode | ( | const ASN1_Object & | obj | ) |
Definition at line 372 of file der_enc.cpp.
References Botan::ASN1_Object::encode_into().
DER_Encoder & Botan::DER_Encoder::encode_if | ( | bool | pred, |
DER_Encoder & | enc | ||
) |
Definition at line 355 of file der_enc.cpp.
References get_contents(), and raw_bytes().
DER_Encoder & Botan::DER_Encoder::encode_if | ( | bool | pred, |
const ASN1_Object & | obj | ||
) |
|
inline |
Definition at line 85 of file der_enc.h.
References Botan::PEM_Code::encode().
Referenced by Botan::PK_Signer::signature().
DER_Encoder & Botan::DER_Encoder::encode_null | ( | ) |
Definition at line 208 of file der_enc.cpp.
References add_object(), Botan::NULL_TAG, and Botan::UNIVERSAL.
Referenced by Botan::EC_Group::DER_encode().
|
inline |
Definition at line 77 of file der_enc.h.
References Botan::PEM_Code::encode().
Referenced by Botan::Extensions::encode_into().
DER_Encoder & Botan::DER_Encoder::end_cons | ( | ) |
Definition at line 147 of file der_enc.cpp.
References raw_bytes().
Referenced by Botan::GOST_3410_PublicKey::algorithm_identifier(), Botan::OCSP::Request::BER_encode(), Botan::PKCS8::BER_encode(), Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), Botan::X509::create_cert_req(), Botan::EC_Group::DER_encode(), Botan::TLS::Session::DER_encode(), Botan::DL_Group::DER_encode(), Botan::Attribute::encode_into(), Botan::AlternativeName::encode_into(), Botan::AlgorithmIdentifier::encode_into(), Botan::X509_DN::encode_into(), Botan::OCSP::CertID::encode_into(), Botan::CRL_Entry::encode_into(), Botan::X509_Object::encode_into(), Botan::Extensions::encode_into(), end_explicit(), Botan::Curve25519_PrivateKey::private_key_bits(), Botan::McEliece_PrivateKey::private_key_bits(), Botan::EC_PrivateKey::private_key_bits(), Botan::RSA_PrivateKey::private_key_bits(), Botan::Private_Key::private_key_info(), Botan::Curve25519_PublicKey::public_key_bits(), Botan::RSA_PublicKey::public_key_bits(), Botan::McEliece_PublicKey::public_key_bits(), Botan::TPM_PrivateKey::public_key_bits(), Botan::ASN1::put_in_sequence(), Botan::PK_Signer::signature(), and Botan::Public_Key::subject_public_key().
DER_Encoder & Botan::DER_Encoder::end_explicit | ( | ) |
Definition at line 174 of file der_enc.cpp.
References end_cons().
Referenced by Botan::OCSP::Request::BER_encode(), Botan::X509::create_cert_req(), and Botan::AlternativeName::encode_into().
secure_vector< uint8_t > Botan::DER_Encoder::get_contents | ( | ) |
Definition at line 124 of file der_enc.cpp.
Referenced by Botan::X509::create_cert_req(), Botan::TLS::Session::DER_encode(), encode_if(), Botan::Curve25519_PrivateKey::private_key_bits(), Botan::DL_Scheme_PrivateKey::private_key_bits(), Botan::McEliece_PrivateKey::private_key_bits(), Botan::EC_PrivateKey::private_key_bits(), Botan::RSA_PrivateKey::private_key_bits(), and Botan::Private_Key::private_key_info().
|
inline |
Definition at line 27 of file der_enc.h.
References Botan::unlock().
Referenced by Botan::GOST_3410_PublicKey::algorithm_identifier(), Botan::OCSP::Request::BER_encode(), Botan::X509_Object::BER_encode(), Botan::PKCS8::BER_encode(), Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), Botan::EC_Group::DER_encode(), Botan::DL_Group::DER_encode(), Botan::Certificate_Store_In_SQL::find_cert(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::X509_Object::make_signed(), Botan::DL_Scheme_PublicKey::public_key_bits(), Botan::Curve25519_PublicKey::public_key_bits(), Botan::McEliece_PublicKey::public_key_bits(), Botan::RSA_PublicKey::public_key_bits(), Botan::GOST_3410_PublicKey::public_key_bits(), Botan::TPM_PrivateKey::public_key_bits(), Botan::ASN1::put_in_sequence(), Botan::Certificate_Store_In_SQL::revoke_cert(), Botan::PK_Signer::signature(), and Botan::Public_Key::subject_public_key().
DER_Encoder & Botan::DER_Encoder::raw_bytes | ( | const uint8_t | val[], |
size_t | len | ||
) |
Definition at line 195 of file der_enc.cpp.
Referenced by add_object(), Botan::X509::create_cert_req(), encode_if(), Botan::Attribute::encode_into(), Botan::X509_DN::encode_into(), Botan::AlgorithmIdentifier::encode_into(), Botan::X509_Object::encode_into(), end_cons(), Botan::X509_Object::make_signed(), Botan::ASN1::put_in_sequence(), and raw_bytes().
DER_Encoder & Botan::DER_Encoder::raw_bytes | ( | const secure_vector< uint8_t > & | val | ) |
Definition at line 182 of file der_enc.cpp.
References raw_bytes().
DER_Encoder & Botan::DER_Encoder::raw_bytes | ( | const std::vector< uint8_t > & | val | ) |
Definition at line 187 of file der_enc.cpp.
References raw_bytes().
DER_Encoder & Botan::DER_Encoder::start_cons | ( | ASN1_Tag | type_tag, |
ASN1_Tag | class_tag = UNIVERSAL |
||
) |
Definition at line 137 of file der_enc.cpp.
Referenced by Botan::GOST_3410_PublicKey::algorithm_identifier(), Botan::OCSP::Request::BER_encode(), Botan::PKCS8::BER_encode(), Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), Botan::X509::create_cert_req(), Botan::EC_Group::DER_encode(), Botan::TLS::Session::DER_encode(), Botan::DL_Group::DER_encode(), Botan::Attribute::encode_into(), Botan::AlternativeName::encode_into(), Botan::AlgorithmIdentifier::encode_into(), Botan::X509_DN::encode_into(), Botan::OCSP::CertID::encode_into(), Botan::CRL_Entry::encode_into(), Botan::X509_Object::encode_into(), Botan::Extensions::encode_into(), Botan::X509_Object::make_signed(), Botan::Curve25519_PrivateKey::private_key_bits(), Botan::McEliece_PrivateKey::private_key_bits(), Botan::EC_PrivateKey::private_key_bits(), Botan::RSA_PrivateKey::private_key_bits(), Botan::Private_Key::private_key_info(), Botan::Curve25519_PublicKey::public_key_bits(), Botan::RSA_PublicKey::public_key_bits(), Botan::McEliece_PublicKey::public_key_bits(), Botan::TPM_PrivateKey::public_key_bits(), Botan::ASN1::put_in_sequence(), Botan::PK_Signer::signature(), start_explicit(), and Botan::Public_Key::subject_public_key().
DER_Encoder & Botan::DER_Encoder::start_explicit | ( | uint16_t | type_tag | ) |
Definition at line 161 of file der_enc.cpp.
References Botan::CONTEXT_SPECIFIC, Botan::SET, and start_cons().
Referenced by Botan::OCSP::Request::BER_encode(), Botan::X509::create_cert_req(), and Botan::AlternativeName::encode_into().