8 #ifndef BOTAN_BER_DECODER_H__
9 #define BOTAN_BER_DECODER_H__
11 #include <botan/asn1_oid.h>
12 #include <botan/data_src.h>
24 std::vector<uint8_t> get_next_octet_string();
28 bool more_items()
const;
52 static_assert(std::is_pod<T>::value,
"Type must be POD");
57 if (obj.
value.size() !=
sizeof(T))
59 "Size mismatch. Object value size is " +
61 "; Output type size is " +
107 uint64_t decode_constrained_integer(
ASN1_Tag type_tag,
121 out =
static_cast<T
>(decode_constrained_integer(type_tag, class_tag,
sizeof(out)));
129 const T& default_value = T());
138 const T& default_value = T());
147 const std::string& error_msg)
152 if(actual != expected)
161 template<
typename Alloc>
178 decode(out, real_type, type_tag, class_tag);
198 explicit BER_Decoder(
const std::vector<uint8_t>& vec);
216 const T& default_value)
227 decode(out, type_tag, class_tag);
249 const T& default_value)
258 decode(out, real_type, real_class);
secure_vector< uint8_t > decode(DataSource &source, std::string &label)
BER_Decoder & decode_integer_type(T &out)
BER_Decoder(DataSource &)
BER_Decoder & decode_optional_string(std::vector< uint8_t, Alloc > &out, ASN1_Tag real_type, uint16_t type_no, ASN1_Tag class_tag=CONTEXT_SPECIFIC)
BER_Decoder & decode_and_check(const T &expected, const std::string &error_msg)
void push_back(const BER_Object &obj)
BER_Decoder & decode(bool &v)
std::string to_string(const BER_Object &obj)
BER_Decoder & decode_optional(T &out, ASN1_Tag type_tag, ASN1_Tag class_tag, const T &default_value=T())
void assert_is_a(ASN1_Tag, ASN1_Tag)
std::vector< T, secure_allocator< T >> secure_vector
secure_vector< uint8_t > value
BER_Decoder start_cons(ASN1_Tag type_tag, ASN1_Tag class_tag=UNIVERSAL)
void copy_mem(T *out, const T *in, size_t n)
BER_Decoder & decode_optional_implicit(T &out, ASN1_Tag type_tag, ASN1_Tag class_tag, ASN1_Tag real_type, ASN1_Tag real_class, const T &default_value=T())
BER_Decoder & decode_integer_type(T &out, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC)
BER_Object get_next_object()
BER_Decoder & get_next_value(T &out, ASN1_Tag type_tag, ASN1_Tag class_tag=CONTEXT_SPECIFIC)
BER_Decoder & verify_end()
BER_Decoder & decode_list(std::vector< T > &out, ASN1_Tag type_tag=SEQUENCE, ASN1_Tag class_tag=UNIVERSAL)