8#include <botan/datastor.h>
9#include <botan/exceptn.h>
10#include <botan/parsing.h>
12#include <botan/internal/stl_util.h>
21 return (m_contents == other.m_contents);
29 return (m_contents.lower_bound(key) != m_contents.end());
36 std::function<
bool (std::string, std::string)> predicate)
const
38 std::multimap<std::string, std::string> out;
40 for(
auto i = m_contents.begin(); i != m_contents.end(); ++i)
41 if(predicate(i->first, i->second))
42 out.insert(std::make_pair(i->first, i->second));
52 std::vector<std::string> out;
53 auto range = m_contents.equal_range(looking_for);
54 for(
auto i = range.first; i != range.second; ++i)
55 out.push_back(i->second);
64 std::vector<std::string> vals =
get(key);
67 throw Invalid_State(
"Data_Store::get1: No values set for " + key);
69 throw Invalid_State(
"Data_Store::get1: More than one value for " + key);
75 const std::string& default_value)
const
77 std::vector<std::string> vals =
get(key);
80 throw Invalid_State(
"Data_Store::get1: More than one value for " + key);
94 std::vector<std::string> vals =
get(key);
97 return std::vector<uint8_t>();
100 throw Invalid_State(
"Data_Store::get1_memvec: Multiple values for " +
110 uint32_t default_val)
const
112 std::vector<std::string> vals =
get(key);
116 else if(vals.size() > 1)
117 throw Invalid_State(
"Data_Store::get1_uint32: Multiple values for " + key);
156 std::multimap<std::string, std::string>::const_iterator i = in.begin();
159 m_contents.insert(*i);
170 [](
const std::string& key,
const std::string&)
172 return (key.find(
"X520.") != std::string::npos);
177 for(
auto i = names.begin(); i != names.end(); ++i)
189 [](
const std::string& key,
const std::string&)
191 return (key ==
"RFC822" ||
199 for(
auto i = names.begin(); i != names.end(); ++i)
void add_attribute(const std::string &type, const std::string &value)
uint32_t get1_uint32(const std::string &, uint32_t=0) const
std::multimap< std::string, std::string > search_for(std::function< bool(std::string, std::string)> predicate) const
std::vector< uint8_t > get1_memvec(const std::string &) const
void add(const std::multimap< std::string, std::string > &)
bool operator==(const Data_Store &) const
std::vector< std::string > get(const std::string &) const
bool has_value(const std::string &) const
std::string get1(const std::string &key) const
void add_attribute(const std::string &key, const std::string &val)
std::string to_string(const BER_Object &obj)
void hex_encode(char output[], const uint8_t input[], size_t input_length, bool uppercase)
void multimap_insert(std::multimap< K, V > &multimap, const K &key, const V &value)
size_t hex_decode(uint8_t output[], const char input[], size_t input_length, size_t &input_consumed, bool ignore_ws)
X509_DN create_dn(const Data_Store &info)
AlternativeName create_alt_name(const Data_Store &info)
uint32_t to_u32bit(const std::string &str)
std::vector< T, secure_allocator< T > > secure_vector