|
Botan 3.13.0
Crypto and TLS for C&
|
Functions | |
| std::vector< uint8_t > | der_sequence_header (size_t contents_len) |
| std::vector< uint8_t > | integer_contents (const BigInt &n) |
| BigInt | integer_from_contents (std::span< const uint8_t > contents) |
| bool | is_der_sequence_header (std::span< const uint8_t > bytes) |
| bool | is_single_der_object (std::span< const uint8_t > bytes, ASN1_Type expected_type, ASN1_Class expected_class) |
| bool | maybe_BER (DataSource &source) |
| std::vector< uint8_t > | put_in_sequence (const std::vector< uint8_t > &contents) |
| std::vector< uint8_t > | put_in_sequence (const uint8_t bits[], size_t len) |
| std::string | to_string (const BER_Object &obj) |
| std::vector< uint8_t > Botan::ASN1::der_sequence_header | ( | size_t | contents_len | ) |
Return the DER tag and length header of a SEQUENCE with the given contents length
| contents_len | the length in bytes of the SEQUENCE contents |
Definition at line 71 of file der_enc.cpp.
References Botan::Constructed, and Botan::Sequence.
Referenced by put_in_sequence(), Botan::OCSP::Response::verify_signature(), and Botan::X509_Object::verify_signature().
| std::vector< uint8_t > Botan::ASN1::integer_contents | ( | const BigInt & | n | ) |
Return the contents octets of the DER encoding of the INTEGER n: big-endian two's complement, minimal length. Zero encodes as a single 0x00 octet.
Definition at line 356 of file der_enc.cpp.
References BOTAN_ASSERT_NOMSG, Botan::BigInt::bytes(), Botan::BigInt::serialize(), and Botan::BigInt::signum().
Referenced by Botan::DER_Encoder::encode().
| BigInt Botan::ASN1::integer_from_contents | ( | std::span< const uint8_t > | contents | ) |
Decode the contents octets of a BER INTEGER (big-endian two's complement). Redundant leading octets are accepted; an empty input is rejected.
Definition at line 801 of file ber_dec.cpp.
References Botan::BigInt::_assign_from_bytes(), Botan::BigInt::Negative, and Botan::BigInt::set_sign().
Referenced by Botan::BER_Decoder::decode(), and Botan::X509_Serial_Number::to_bigint().
| bool Botan::ASN1::is_der_sequence_header | ( | std::span< const uint8_t > | bytes | ) |
Return true if the bytes are exactly one DER-encoded SEQUENCE, that is a SEQUENCE whose tag plus length header plus contents span the entire buffer with no trailing data. The contents themselves are not otherwise validated.
Definition at line 1128 of file ber_dec.cpp.
References Botan::Constructed, is_single_der_object(), Botan::Sequence, and Botan::Universal.
Referenced by Botan::AlgorithmIdentifier::decode_from().
| bool Botan::ASN1::is_single_der_object | ( | std::span< const uint8_t > | bytes, |
| ASN1_Type | expected_type, | ||
| ASN1_Class | expected_class ) |
Definition at line 1100 of file ber_dec.cpp.
References Botan::NoObject.
Referenced by Botan::AlgorithmIdentifier::decode_from(), and is_der_sequence_header().
| bool Botan::ASN1::maybe_BER | ( | DataSource & | src | ) |
Heuristics tests; is this object possibly BER?
| src | a data source that will be peeked at but not modified |
Definition at line 231 of file asn1_obj.cpp.
References BOTAN_ASSERT_EQUAL, Botan::Constructed, Botan::DataSource::peek_byte(), Botan::DataSource::read_byte(), and Botan::Sequence.
Referenced by Botan::X509_Object::load_data(), and Botan::X509::load_key().
| std::vector< uint8_t > Botan::ASN1::put_in_sequence | ( | const std::vector< uint8_t > & | val | ) |
Return the contents wrapped in a DER SEQUENCE
| val | the contents of the SEQUENCE |
Definition at line 208 of file asn1_obj.cpp.
References put_in_sequence().
Referenced by Botan::GeneralName::binary_name(), botan_x509_crl_view_binary_values(), put_in_sequence(), and Botan::X509_Object::tbs_data().
| std::vector< uint8_t > Botan::ASN1::put_in_sequence | ( | const uint8_t | bits[], |
| size_t | len ) |
Return the contents wrapped in a DER SEQUENCE
| bits | the contents of the SEQUENCE |
| len | the length of bits in bytes |
Definition at line 212 of file asn1_obj.cpp.
References der_sequence_header().
| std::string Botan::ASN1::to_string | ( | const BER_Object & | obj | ) |
Return the contents of a BER object interpreted as a string
| obj | the object whose contents are converted |
Definition at line 224 of file asn1_obj.cpp.
References Botan::bytes_to_string(), and Botan::BER_Object::data().
Referenced by Botan::AlternativeName::decode_from(), Botan::ASN1_String::decode_from(), Botan::ASN1_Time::decode_from(), and Botan::GeneralName::decode_from().