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,
127 getGroup(
const std::string& groupId)
const;
140 using AnchorContainerBase = boost::multi_index::multi_index_container<
142 boost::multi_index::indexed_by<
143 boost::multi_index::ordered_unique<
144 boost::multi_index::const_mem_fun<Data, const Name&, &Data::getName>
150 public AnchorContainerBase
157 remove(
const Name& certName)
final;
163 using GroupContainer = boost::multi_index::multi_index_container<
164 shared_ptr<TrustAnchorGroup>,
165 boost::multi_index::indexed_by<
166 boost::multi_index::hashed_unique<
167 boost::multi_index::const_mem_fun<TrustAnchorGroup, const std::string&, &TrustAnchorGroup::getId>
172 GroupContainer m_groups;
173 AnchorContainer m_anchors;
Represents an Interest packet.
Represents an absolute name.
Represents an NDN certificate following the version 2.0 format.
represents 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