diff options
author | Jack Lloyd <[email protected]> | 2017-01-05 18:40:30 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-01-05 18:40:30 -0500 |
commit | c1d47622ae157ef353e4fe9b7849246516678b9d (patch) | |
tree | 991585f9ab05fc69a69145343a424f22a39ce342 /src/lib/x509/datastor.h | |
parent | 1df7574b3715848ead3ba349069a9f57ba9ac5df (diff) | |
parent | d5f42acd711194c4738859180471b0bd82bc00cb (diff) |
Merge GH #804 Move Data_Store type to x509 module
Diffstat (limited to 'src/lib/x509/datastor.h')
-rw-r--r-- | src/lib/x509/datastor.h | 61 |
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 |