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>
56 class Error :
public std::runtime_error
59 using std::runtime_error::runtime_error;
89 insert(
const std::string& groupId,
const std::filesystem::path& path,
124 getGroup(
const std::string& groupId)
const;
137 using AnchorContainerBase = boost::multi_index::multi_index_container<
139 boost::multi_index::indexed_by<
140 boost::multi_index::ordered_unique<
141 boost::multi_index::const_mem_fun<Data, const Name&, &Data::getName>
147 public AnchorContainerBase
154 remove(
const Name& certName)
final;
160 using GroupContainer = boost::multi_index::multi_index_container<
161 shared_ptr<TrustAnchorGroup>,
162 boost::multi_index::indexed_by<
163 boost::multi_index::hashed_unique<
164 boost::multi_index::const_mem_fun<TrustAnchorGroup, const std::string&, &TrustAnchorGroup::getId>
169 GroupContainer m_groups;
170 AnchorContainer m_anchors;
Represents an Interest packet.
Represents an absolute name.
Represents an NDN certificate.
A container for trust anchors.
const Certificate * find(const Name &keyName) const
Search for certificate across all groups (longest prefix match).
void insert(const std::string &groupId, Certificate &&cert)
Insert a static trust anchor.
size_t size() const
Get number of trust anchors across all groups.
TrustAnchorGroup & getGroup(const std::string &groupId) const
Get trusted anchor group.
void clear()
Remove all static or dynamic anchors.
A group of trust anchors.
Contains the ndn-cxx security framework.
::boost::chrono::nanoseconds nanoseconds