Botan  2.13.0
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/x509_dn.h>
12 #include <botan/asn1_alt_name.h>
13 #include <functional>
14 #include <string>
15 #include <vector>
16 #include <map>
17 
19 
20 namespace Botan {
21 
22 /**
23 * Data Store
24 *
25 * This class is used internally by the library, and exposed for ABI
26 * reasons. There is no reason for applications to use this type directly.
27 * It will be removed in a future major release.
28 */
30  {
31  public:
32  /**
33  * A search function
34  */
35  bool operator==(const Data_Store&) const;
36 
37  std::multimap<std::string, std::string> search_for(
38  std::function<bool (std::string, std::string)> predicate) const;
39 
40  std::vector<std::string> get(const std::string&) const;
41 
42  std::string get1(const std::string& key) const;
43 
44  std::string get1(const std::string& key,
45  const std::string& default_value) const;
46 
47  std::vector<uint8_t> get1_memvec(const std::string&) const;
48  uint32_t get1_uint32(const std::string&, uint32_t = 0) const;
49 
50  bool has_value(const std::string&) const;
51 
52  void add(const std::multimap<std::string, std::string>&);
53  void add(const std::string&, const std::string&);
54  void add(const std::string&, uint32_t);
55  void add(const std::string&, const secure_vector<uint8_t>&);
56  void add(const std::string&, const std::vector<uint8_t>&);
57  private:
58  std::multimap<std::string, std::string> m_contents;
59  };
60 
61 /*
62 * Data Store Extraction Operations
63 */
64 
65 /*
66 * Create and populate a X509_DN
67 * @param info data store containing DN information
68 * @return DN containing attributes from data store
69 */
71 BOTAN_DEPRECATED("Avoid roundtripping names through Data_Store")
72 create_dn(const Data_Store& info);
73 
74 /*
75 * Create and populate an AlternativeName
76 * @param info data store containing AlternativeName information
77 * @return AlternativeName containing attributes from data store
78 */
80 BOTAN_DEPRECATED("Avoid roundtripping names through Data_Store")
81 create_alt_name(const Data_Store& info);
82 
83 
84 }
85 
86 #endif
#define BOTAN_UNSTABLE_API
Definition: compiler.h:38
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:74
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:65
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
X509_DN create_dn(const Data_Store &info)
Definition: datastor.cpp:167