|
Botan 3.12.0
Crypto and TLS for C&
|
#include <ber_dec.h>
Classes | |
| class | Limits |
|
inline |
Set up to BER decode the data in buf of length len
Definition at line 64 of file ber_dec.h.
References BER_Decoder(), and limits().
Referenced by BER_Decoder(), BER_Decoder(), BER_Decoder(), BER_Decoder(), BER_Decoder(), decode(), decode(), decode(), decode(), decode(), decode(), decode(), decode(), decode(), decode(), decode_and_check(), decode_integer_type(), decode_integer_type(), decode_list(), decode_null(), decode_octet_string_bigint(), decode_optional(), decode_optional(), decode_optional_implicit(), decode_optional_string(), decode_optional_string(), discard_remaining(), end_cons(), get_next(), get_next_value(), operator=(), operator=(), raw_bytes(), start_cons(), start_context_specific(), start_explicit_context_specific(), start_sequence(), start_set(), verify_end(), verify_end(), and ~BER_Decoder().
|
explicit |
Set up to BER decode the data in buf
Definition at line 548 of file ber_dec.cpp.
References limits().
|
explicit |
Set up to BER decode the data in src
Definition at line 543 of file ber_dec.cpp.
References limits().
|
inline |
Set up to BER decode the data in obj
Definition at line 80 of file ber_dec.h.
References Botan::BER_Decoder::Limits::BER(), BER_Decoder(), BOTAN_FUTURE_EXPLICIT, and limits().
|
inline |
Set up to BER decode the data in obj TODO(Botan4) remove this?
Definition at line 87 of file ber_dec.h.
References BER_Decoder(), and BOTAN_FUTURE_EXPLICIT.
|
delete |
References BER_Decoder().
|
defaultnoexcept |
References BER_Decoder().
|
default |
References BER_Decoder(), and get_next_value().
| BER_Decoder & Botan::BER_Decoder::decode | ( | ASN1_Object & | obj, |
| ASN1_Type | type_tag = ASN1_Type::NoObject, | ||
| ASN1_Class | class_tag = ASN1_Class::NoObject ) |
Definition at line 560 of file ber_dec.cpp.
References BER_Decoder(), and decode().
|
inline |
Definition at line 230 of file ber_dec.h.
References BER_Decoder(), decode(), Botan::Integer, and Botan::Universal.
Referenced by decode().
| BER_Decoder & Botan::BER_Decoder::decode | ( | BigInt & | v, |
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag = ASN1_Class::ContextSpecific ) |
Definition at line 660 of file ber_dec.cpp.
References Botan::BigInt::_assign_from_bytes(), Botan::BER_Object::assert_is_a(), BER_Decoder(), Botan::BER_Object::bits(), Botan::BigInt::clear(), Botan::BER_Object::data(), Botan::BigInt::flip_sign(), get_next_object(), and Botan::BER_Object::length().
|
inline |
Decode a BER encoded BOOLEAN
Definition at line 220 of file ber_dec.h.
References BER_Decoder(), Botan::Boolean, decode(), and Botan::Universal.
Referenced by decode(), decode(), decode(), decode(), decode_and_check(), decode_constrained_integer(), Botan::AlgorithmIdentifier::decode_from(), Botan::AlternativeName::decode_from(), Botan::Attribute::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdOrRange::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressFamily::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressOrRange< V >::decode_from(), Botan::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::CRL_Entry::decode_from(), Botan::Extensions::decode_from(), Botan::GeneralSubtree::decode_from(), Botan::OCSP::CertID::decode_from(), Botan::OCSP::SingleResponse::decode_from(), Botan::X509_DN::decode_from(), Botan::X509_Object::decode_from(), decode_list(), decode_octet_string_bigint(), decode_optional(), decode_optional_implicit(), decode_optional_string(), Botan::Ed25519_PrivateKey::Ed25519_PrivateKey(), Botan::Ed448_PrivateKey::Ed448_PrivateKey(), get_next_octet_string(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::X509::load_key(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PublicKey::McEliece_PublicKey(), Botan::pbes2_decrypt(), Botan::OCSP::Response::Response(), Botan::RSA_PublicKey::RSA_PublicKey(), Botan::TLS::Session::Session(), and Botan::X25519_PrivateKey::X25519_PrivateKey().
| BER_Decoder & Botan::BER_Decoder::decode | ( | bool & | v, |
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag = ASN1_Class::ContextSpecific ) |
Definition at line 587 of file ber_dec.cpp.
References Botan::BER_Object::assert_is_a(), BER_Decoder(), Botan::BER_Object::bits(), get_next_object(), and Botan::BER_Object::length().
| BER_Decoder & Botan::BER_Decoder::decode | ( | secure_vector< uint8_t > & | v, |
| ASN1_Type | real_type, | ||
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag = ASN1_Class::ContextSpecific ) |
Definition at line 766 of file ber_dec.cpp.
References BER_Decoder(), Botan::BitString, get_next_object(), and Botan::OctetString.
|
inline |
Definition at line 225 of file ber_dec.h.
References BER_Decoder(), decode(), Botan::Integer, and Botan::Universal.
Referenced by decode().
| BER_Decoder & Botan::BER_Decoder::decode | ( | size_t & | v, |
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag = ASN1_Class::ContextSpecific ) |
Definition at line 610 of file ber_dec.cpp.
References BER_Decoder(), Botan::BigInt::bits(), Botan::BigInt::byte_at(), decode(), and Botan::BigInt::signum().
| BER_Decoder & Botan::BER_Decoder::decode | ( | std::vector< uint8_t > & | v, |
| ASN1_Type | real_type, | ||
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag = ASN1_Class::ContextSpecific ) |
Definition at line 779 of file ber_dec.cpp.
References BER_Decoder(), Botan::BitString, get_next_object(), and Botan::OctetString.
|
inline |
Definition at line 242 of file ber_dec.h.
References BER_Decoder(), decode(), and Botan::Universal.
|
inline |
Definition at line 314 of file ber_dec.h.
References BER_Decoder(), and decode().
Referenced by Botan::EC_PrivateKey::EC_PrivateKey(), Botan::OCSP::Response::Response(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::TLS::Session::Session().
| uint64_t Botan::BER_Decoder::decode_constrained_integer | ( | ASN1_Type | type_tag, |
| ASN1_Class | class_tag, | ||
| size_t | T_bytes ) |
Definition at line 633 of file ber_dec.cpp.
References Botan::BigInt::bits(), Botan::BigInt::byte_at(), decode(), and Botan::BigInt::is_negative().
Referenced by decode_integer_type().
|
inline |
Definition at line 274 of file ber_dec.h.
References BER_Decoder(), decode_integer_type(), Botan::Integer, and Botan::Universal.
Referenced by decode_integer_type(), and Botan::TLS::Session::Session().
|
inline |
Definition at line 279 of file ber_dec.h.
References BER_Decoder(), Botan::ContextSpecific, and decode_constrained_integer().
| BER_Decoder & Botan::BER_Decoder::decode_list | ( | std::vector< T > & | out, |
| ASN1_Type | type_tag = ASN1_Type::Sequence, | ||
| ASN1_Class | class_tag = ASN1_Class::Universal ) |
Definition at line 430 of file ber_dec.h.
References BER_Decoder(), decode(), end_cons(), more_items(), push_back(), and start_cons().
Referenced by Botan::Cert_Extension::ASBlocks::ASIdentifierChoice::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressChoice< V >::decode_from(), decode_optional_list(), Botan::OCSP::Response::Response(), and Botan::TLS::Session::Session().
| BER_Decoder & Botan::BER_Decoder::decode_null | ( | ) |
Definition at line 568 of file ber_dec.cpp.
References Botan::BER_Object::assert_is_a(), BER_Decoder(), get_next_object(), Botan::BER_Object::length(), Botan::Null, and Botan::Universal.
Referenced by Botan::Cert_Extension::ASBlocks::ASIdentifierChoice::decode_from(), and Botan::Cert_Extension::IPAddressBlocks::IPAddressChoice< V >::decode_from().
| BER_Decoder & Botan::BER_Decoder::decode_octet_string_bigint | ( | BigInt & | b | ) |
Decode an integer value which is typed as an octet string
Definition at line 577 of file ber_dec.cpp.
References BER_Decoder(), decode(), Botan::BigInt::from_bytes(), and Botan::OctetString.
| BER_Decoder & Botan::BER_Decoder::decode_optional | ( | std::optional< T > & | out, |
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag ) |
Definition at line 381 of file ber_dec.h.
References BER_Decoder(), decode(), Botan::ExplicitContextSpecific, get_next_object(), Botan::BER_Object::is_a(), and push_back().
|
inline |
Definition at line 285 of file ber_dec.h.
References BER_Decoder(), and decode_optional().
Referenced by Botan::Extensions::decode_from(), Botan::GeneralSubtree::decode_from(), Botan::OCSP::SingleResponse::decode_from(), decode_optional(), and Botan::OCSP::Response::Response().
| BER_Decoder & Botan::BER_Decoder::decode_optional_implicit | ( | T & | out, |
| ASN1_Type | type_tag, | ||
| ASN1_Class | class_tag, | ||
| ASN1_Type | real_type, | ||
| ASN1_Class | real_class, | ||
| const T & | default_value = T() ) |
Definition at line 405 of file ber_dec.h.
References BER_Decoder(), decode(), get_next_object(), Botan::BER_Object::is_a(), and push_back().
Referenced by Botan::Cert_Extension::CRL_Distribution_Points::Distribution_Point::decode_from().
| bool Botan::BER_Decoder::decode_optional_list | ( | std::vector< T > & | out, |
| ASN1_Type | type_tag = ASN1_Type::Sequence, | ||
| ASN1_Class | class_tag = ASN1_Class::Universal ) |
Definition at line 448 of file ber_dec.h.
References decode_list(), and peek_next_object().
|
inline |
Definition at line 353 of file ber_dec.h.
References BER_Decoder(), Botan::ContextSpecific, and decode_optional_string().
|
inline |
Definition at line 329 of file ber_dec.h.
References BER_Decoder(), Botan::ContextSpecific, decode(), Botan::ExplicitContextSpecific, get_next_object(), Botan::BER_Object::is_a(), and push_back().
Referenced by decode_optional_string(), and Botan::OCSP::Response::Response().
| BER_Decoder & Botan::BER_Decoder::discard_remaining | ( | ) |
Discard any data that remains unread Returns (*this)
Definition at line 398 of file ber_dec.cpp.
References BER_Decoder().
Referenced by Botan::Ed25519_PrivateKey::Ed25519_PrivateKey(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), and Botan::X25519_PrivateKey::X25519_PrivateKey().
| BER_Decoder & Botan::BER_Decoder::end_cons | ( | ) |
Finish decoding a constructed data, throws if any data remains. Returns the parent of *this (ie the object on which start_cons was called).
Definition at line 524 of file ber_dec.cpp.
References BER_Decoder().
Referenced by Botan::AlgorithmIdentifier::decode_from(), Botan::Attribute::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdOrRange::decode_from(), Botan::Cert_Extension::CRL_Distribution_Points::Distribution_Point::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressFamily::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressOrRange< V >::decode_from(), Botan::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::CRL_Entry::decode_from(), Botan::Extensions::decode_from(), Botan::GeneralSubtree::decode_from(), Botan::OCSP::CertID::decode_from(), Botan::OCSP::SingleResponse::decode_from(), Botan::X509_DN::decode_from(), Botan::X509_Object::decode_from(), decode_list(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::X509::load_key(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PublicKey::McEliece_PublicKey(), Botan::pbes2_decrypt(), Botan::OCSP::Response::Response(), and Botan::RSA_PublicKey::RSA_PublicKey().
|
inline |
Definition at line 106 of file ber_dec.h.
References BER_Decoder(), and get_next_object().
Referenced by Botan::OCSP::SingleResponse::decode_from().
| BER_Object Botan::BER_Decoder::get_next_object | ( | ) |
Get the next object in the data stream. If EOF, returns an object with type NO_OBJECT.
Definition at line 426 of file ber_dec.cpp.
References Botan::Eoc, Botan::BER_Object::is_set(), Botan::NoObject, Botan::BER_Object::tagging(), and Botan::Universal.
Referenced by decode(), decode(), decode(), decode(), Botan::AlternativeName::decode_from(), Botan::ASN1_String::decode_from(), Botan::ASN1_Time::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::GeneralName::decode_from(), Botan::OID::decode_from(), decode_null(), decode_optional(), decode_optional_implicit(), decode_optional_string(), get_next(), peek_next_object(), and start_cons().
|
inline |
Definition at line 232 of file ber_dec.h.
References decode(), and Botan::OctetString.
Referenced by Botan::OCSP::Response::Response().
|
inline |
Get next object and copy value to POD type Asserts value length is equal to POD type sizeof. Asserts Type tag and optional Class tag according to parameters. Copy value to POD type (struct, union, C-style array, std::array, etc.).
| out | POD type reference where to copy object value |
| type_tag | ASN1_Type enum to assert type on object read |
| class_tag | ASN1_Type enum to assert class on object read (default: CONTEXT_SPECIFIC) |
Definition at line 189 of file ber_dec.h.
References BER_Decoder(), Botan::BER_Object::bits(), Botan::ContextSpecific, get_next_value(), and Botan::BER_Object::length().
Referenced by get_next_value(), and ~BER_Decoder().
|
inline |
Returns the limits currently applied to this decoder
Definition at line 98 of file ber_dec.h.
References limits().
Referenced by BER_Decoder(), BER_Decoder(), BER_Decoder(), BER_Decoder(), Botan::AlternativeName::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::GeneralName::decode_from(), Botan::X509_DN::decode_from(), and limits().
| bool Botan::BER_Decoder::more_items | ( | ) | const |
Return true if there is at least one more item remaining
Definition at line 371 of file ber_dec.cpp.
Referenced by Botan::AlternativeName::decode_from(), Botan::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::CRL_Entry::decode_from(), Botan::Extensions::decode_from(), Botan::X509_DN::decode_from(), decode_list(), and Botan::OCSP::Response::Response().
|
defaultnoexcept |
References BER_Decoder().
|
delete |
References BER_Decoder().
| const BER_Object & Botan::BER_Decoder::peek_next_object | ( | ) |
Peek at the next object without removing it from the stream
If an object has been pushed, then it returns that object. Otherwise it reads the next object and pushes it. Thus, a you call peek_next_object followed by push_back without a subsequent read, it will fail.
Definition at line 415 of file ber_dec.cpp.
References get_next_object().
Referenced by Botan::Cert_Extension::ASBlocks::ASIdentifierChoice::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdOrRange::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressChoice< V >::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressFamily::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressOrRange< V >::decode_from(), and decode_optional_list().
| void Botan::BER_Decoder::push_back | ( | BER_Object && | obj | ) |
Push an object back onto the stream. Throws if another object was previously pushed and has not been subsequently read out.
Definition at line 507 of file ber_dec.cpp.
| void Botan::BER_Decoder::push_back | ( | const BER_Object & | obj | ) |
Push an object back onto the stream. Throws if another object was previously pushed and has not been subsequently read out.
Definition at line 500 of file ber_dec.cpp.
Referenced by decode_list(), decode_optional(), decode_optional_implicit(), decode_optional_string(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), and Botan::McEliece_PrivateKey::McEliece_PrivateKey().
|
inline |
Definition at line 203 of file ber_dec.h.
References BER_Decoder().
Referenced by Botan::AlgorithmIdentifier::decode_from(), Botan::Attribute::decode_from(), Botan::X509_DN::decode_from(), Botan::X509_Object::decode_from(), and Botan::OCSP::Response::Response().
| BER_Decoder Botan::BER_Decoder::start_cons | ( | ASN1_Type | type_tag, |
| ASN1_Class | class_tag ) |
Definition at line 514 of file ber_dec.cpp.
References Botan::BER_Object::assert_is_a(), BER_Decoder(), Botan::Constructed, and get_next_object().
Referenced by decode_list(), start_context_specific(), start_explicit_context_specific(), start_sequence(), and start_set().
|
inline |
Definition at line 164 of file ber_dec.h.
References BER_Decoder(), Botan::ContextSpecific, and start_cons().
Referenced by Botan::Cert_Extension::CRL_Distribution_Points::Distribution_Point::decode_from(), and Botan::OCSP::Response::Response().
|
inline |
Definition at line 168 of file ber_dec.h.
References BER_Decoder(), Botan::ExplicitContextSpecific, and start_cons().
|
inline |
Definition at line 160 of file ber_dec.h.
References BER_Decoder(), Botan::Sequence, start_cons(), and Botan::Universal.
Referenced by Botan::AlgorithmIdentifier::decode_from(), Botan::AlternativeName::decode_from(), Botan::Attribute::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdOrRange::decode_from(), Botan::Cert_Extension::CRL_Distribution_Points::Distribution_Point::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressFamily::decode_from(), Botan::Cert_Extension::IPAddressBlocks::IPAddressOrRange< V >::decode_from(), Botan::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::CRL_Entry::decode_from(), Botan::Extensions::decode_from(), Botan::GeneralSubtree::decode_from(), Botan::OCSP::CertID::decode_from(), Botan::OCSP::SingleResponse::decode_from(), Botan::X509_DN::decode_from(), Botan::X509_Object::decode_from(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::X509::load_key(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PublicKey::McEliece_PublicKey(), Botan::pbes2_decrypt(), Botan::OCSP::Response::Response(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RSA_PublicKey::RSA_PublicKey(), and Botan::TLS::Session::Session().
|
inline |
Definition at line 162 of file ber_dec.h.
References BER_Decoder(), Botan::Set, start_cons(), and Botan::Universal.
Referenced by Botan::Attribute::decode_from(), and Botan::X509_DN::decode_from().
| BER_Decoder & Botan::BER_Decoder::verify_end | ( | ) |
Verify the stream is concluded, throws otherwise. Returns (*this)
Definition at line 381 of file ber_dec.cpp.
References BER_Decoder(), and verify_end().
Referenced by Botan::AlternativeName::decode_from(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::decode_from(), Botan::Extensions::decode_from(), Botan::Ed448_PrivateKey::Ed448_PrivateKey(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::X509::load_key(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PublicKey::McEliece_PublicKey(), Botan::pbes2_decrypt(), Botan::PSS_Params::PSS_Params(), Botan::OCSP::Response::Response(), Botan::RSA_PublicKey::RSA_PublicKey(), and verify_end().
| BER_Decoder & Botan::BER_Decoder::verify_end | ( | std::string_view | err_msg | ) |
Verify the stream is concluded, throws otherwise. Returns (*this)
Definition at line 388 of file ber_dec.cpp.
References BER_Decoder().