8 #ifndef BOTAN_DER_ENCODER_H__
9 #define BOTAN_DER_ENCODER_H__
11 #include <botan/asn1_obj.h>
28 {
return unlock(get_contents()); }
37 DER_Encoder& raw_bytes(
const uint8_t val[],
size_t len);
39 DER_Encoder& raw_bytes(
const std::vector<uint8_t>& val);
79 if(value != default_value)
87 for(
size_t i = 0; i != values.size(); ++i)
97 const uint8_t rep[],
size_t length);
100 const std::vector<uint8_t>& rep)
102 return add_object(type_tag, class_tag, rep.data(), rep.size());
108 return add_object(type_tag, class_tag, rep.data(), rep.size());
112 const std::string& str);
123 void add_bytes(
const uint8_t[],
size_t);
128 std::vector< secure_vector<uint8_t> > m_set_contents;
131 secure_vector<uint8_t> m_contents;
132 std::vector<DER_Sequence> m_subsequences;
DER_Encoder & add_object(ASN1_Tag type_tag, ASN1_Tag class_tag, const std::vector< uint8_t > &rep)
DER_Encoder & encode_list(const std::vector< T > &values)
DER_Encoder & encode_optional(const T &value, const T &default_value)
std::vector< uint8_t > get_contents_unlocked()
std::string encode(const uint8_t der[], size_t length, const std::string &label, size_t width)
std::vector< T, secure_allocator< T >> secure_vector
DER_Encoder & add_object(ASN1_Tag type_tag, ASN1_Tag class_tag, const secure_vector< uint8_t > &rep)
std::vector< T > unlock(const secure_vector< T > &in)