Botan  2.18.2
Crypto and TLS for C++11
datastor.h
Go to the documentation of this file.
1 /*
2 * Data Store
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_DATA_STORE_H_
9 #define BOTAN_DATA_STORE_H_
10 
11 #include <botan/pkix_types.h>
12 #include <functional>
13 #include <string>
14 #include <vector>
15 #include <map>
16 
18 
19 namespace Botan {
20 
21 /**
22 * Data Store
23 *
24 * This class is used internally by the library, and exposed for ABI
25 * reasons. There is no reason for applications to use this type directly.
26 * It will be removed in a future major release.
27 */
29  {
30  public:
31  /**
32  * A search function
33  */
34  bool operator==(const Data_Store&) const;
35 
36  std::multimap<std::string, std::string> search_for(
37  std::function<bool (std::string, std::string)> predicate) const;
38 
39  std::vector<std::string> get(const std::string&) const;
40 
41  std::string get1(const std::string& key) const;
42 
43  std::string get1(const std::string& key,
44  const std::string& default_value) const;
45 
46  std::vector<uint8_t> get1_memvec(const std::string&) const;
47  uint32_t get1_uint32(const std::string&, uint32_t = 0) const;
48 
49  bool has_value(const std::string&) const;
50 
51  void add(const std::multimap<std::string, std::string>&);
52  void add(const std::string&, const std::string&);
53  void add(const std::string&, uint32_t);
54  void add(const std::string&, const secure_vector<uint8_t>&);
55  void add(const std::string&, const std::vector<uint8_t>&);
56  private:
57  std::multimap<std::string, std::string> m_contents;
58  };
59 
60 /*
61 * Data Store Extraction Operations
62 */
63 
64 /*
65 * Create and populate a X509_DN
66 * @param info data store containing DN information
67 * @return DN containing attributes from data store
68 */
70 BOTAN_DEPRECATED("Avoid roundtripping names through Data_Store")
71 create_dn(const Data_Store& info);
72 
73 /*
74 * Create and populate an AlternativeName
75 * @param info data store containing AlternativeName information
76 * @return AlternativeName containing attributes from data store
77 */
79 BOTAN_DEPRECATED("Avoid roundtripping names through Data_Store")
80 create_alt_name(const Data_Store& info);
81 
82 
83 }
84 
85 #endif
#define BOTAN_UNSTABLE_API
Definition: compiler.h:44
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Definition: alg_id.cpp:13
AlternativeName create_alt_name(const Data_Store &info)
Definition: datastor.cpp:186
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
Definition: alg_id.cpp:65
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:65
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:136
X509_DN create_dn(const Data_Store &info)
Definition: datastor.cpp:167