aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509/datastor.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-01-04 13:40:19 -0500
committerJack Lloyd <[email protected]>2017-01-04 13:40:19 -0500
commitd5f42acd711194c4738859180471b0bd82bc00cb (patch)
tree46c0d5392714e42e1de812c8630f70d88ae9c24c /src/lib/x509/datastor.h
parent51b83c2f3807cfd36744b94dfe337a6d31f00847 (diff)
Move Data_Store from utils to x509
It is not a general purpose util or something we want applications to use. It is only used by x509 and hopefully will be removed from there soon enough.
Diffstat (limited to 'src/lib/x509/datastor.h')
-rw-r--r--src/lib/x509/datastor.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/lib/x509/datastor.h b/src/lib/x509/datastor.h
new file mode 100644
index 000000000..e5e8b3f1b
--- /dev/null
+++ b/src/lib/x509/datastor.h
@@ -0,0 +1,61 @@
+/*
+* Data Store
+* (C) 1999-2007 Jack Lloyd
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#ifndef BOTAN_DATA_STORE_H__
+#define BOTAN_DATA_STORE_H__
+
+#include <botan/secmem.h>
+#include <functional>
+#include <utility>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace Botan {
+
+/**
+* Data Store
+*
+* This class is used internally by the library, and exposed for ABI
+* reasons. There is no reason for applications to use this type directly.
+* It will be removed in a future major release.
+*/
+class BOTAN_DLL Data_Store
+ {
+ public:
+ /**
+ * A search function
+ */
+ bool operator==(const Data_Store&) const;
+
+ std::multimap<std::string, std::string> search_for(
+ std::function<bool (std::string, std::string)> predicate) const;
+
+ std::vector<std::string> get(const std::string&) const;
+
+ std::string get1(const std::string& key) const;
+
+ std::string get1(const std::string& key,
+ const std::string& default_value) const;
+
+ std::vector<uint8_t> get1_memvec(const std::string&) const;
+ uint32_t get1_uint32(const std::string&, uint32_t = 0) const;
+
+ bool has_value(const std::string&) const;
+
+ void add(const std::multimap<std::string, std::string>&);
+ void add(const std::string&, const std::string&);
+ void add(const std::string&, uint32_t);
+ void add(const std::string&, const secure_vector<uint8_t>&);
+ void add(const std::string&, const std::vector<uint8_t>&);
+ private:
+ std::multimap<std::string, std::string> m_contents;
+ };
+
+}
+
+#endif