8#include <botan/asn1_obj.h>
10#include <botan/ber_dec.h>
11#include <botan/der_enc.h>
12#include <botan/internal/asn1_utils.h>
20 m_oid(
oid), m_parameters(param) {}
32 constexpr uint8_t DER_NULL[] = {0x05, 0x00};
35 m_parameters.assign(DER_NULL, DER_NULL + 2);
43 constexpr uint8_t DER_NULL[2] = {0x05, 0x00};
46 m_parameters.assign(DER_NULL, DER_NULL + 2);
51 return (m_parameters.size() == 2 && (m_parameters[0] == 0x05) && (m_parameters[1] == 0x00));
88 const bool acceptable_parameters = [&]() {
104 if(!acceptable_parameters) {
105 throw Decoding_Error(
"AlgorithmIdentifier parameters were not NULL, a SEQUENCE, an OID, or an OCTET STRING");
void encode_into(DER_Encoder &to) const override
bool parameters_are_null_or_empty() const
const std::vector< uint8_t > & parameters() const
bool parameters_are_null() const
void decode_from(BER_Decoder &from) override
AlgorithmIdentifier()=default
BER_Decoder & decode(bool &out)
BER_Decoder & raw_bytes(std::vector< uint8_t, Alloc > &out)
BER_Decoder start_sequence()
DER_Encoder & start_sequence()
DER_Encoder & raw_bytes(const uint8_t val[], size_t len)
DER_Encoder & encode(bool b)
bool is_single_der_object(std::span< const uint8_t > bytes, ASN1_Type expected_type, ASN1_Class expected_class)
bool is_der_sequence_header(std::span< const uint8_t > bytes)
bool operator!=(const AlgorithmIdentifier &x, const AlgorithmIdentifier &y)
bool operator==(const AlgorithmIdentifier &x, const AlgorithmIdentifier &y)