22 #ifndef NDN_CXX_SECURITY_TRUST_ANCHOR_CONTAINER_HPP
23 #define NDN_CXX_SECURITY_TRUST_ANCHOR_CONTAINER_HPP
29 #include <boost/multi_index_container.hpp>
30 #include <boost/multi_index/hashed_index.hpp>
31 #include <boost/multi_index/ordered_index.hpp>
32 #include <boost/multi_index/mem_fun.hpp>
58 class Error :
public std::runtime_error
61 using std::runtime_error::runtime_error;
91 insert(
const std::string& groupId,
const boost::filesystem::path& path,
126 getGroup(
const std::string& groupId)
const;
139 using AnchorContainerBase = boost::multi_index::multi_index_container<
141 boost::multi_index::indexed_by<
142 boost::multi_index::ordered_unique<
143 boost::multi_index::const_mem_fun<Data, const Name&, &Data::getName>
149 public AnchorContainerBase
156 remove(
const Name& certName)
final;
162 using GroupContainer = boost::multi_index::multi_index_container<
163 shared_ptr<TrustAnchorGroup>,
164 boost::multi_index::indexed_by<
165 boost::multi_index::hashed_unique<
166 boost::multi_index::const_mem_fun<TrustAnchorGroup, const std::string&, &TrustAnchorGroup::getId>
171 GroupContainer m_groups;
172 AnchorContainer m_anchors;
Represents an Interest packet.
Represents an absolute name.
Represents an NDN certificate.
A container for trust anchors.
void insert(const std::string &groupId, Certificate &&cert)
Insert a static trust anchor.
const Certificate * find(const Name &keyName) const
Search for certificate across all groups (longest prefix match).
void clear()
Remove all static or dynamic anchors.
size_t size() const
Get number of trust anchors across all groups.
TrustAnchorGroup & getGroup(const std::string &groupId) const
Get trusted anchor group.
A group of trust anchors.
boost::chrono::nanoseconds nanoseconds