22 #ifndef NDN_SECURITY_V2_TRUST_ANCHOR_CONTAINER_HPP 23 #define NDN_SECURITY_V2_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,
92 time::nanoseconds refreshPeriod,
bool isDir =
false);
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
154 add(Certificate&& cert)
final;
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;
180 #endif // NDN_SECURITY_V2_TRUST_ANCHOR_CONTAINER_HPP
The certificate following the certificate format naming convention.
const Certificate * find(const Name &keyName) const
Search for certificate across all groups (longest prefix match)
size_t size() const
Get number of trust anchors across all groups.
void insert(const std::string &groupId, Certificate &&cert)
Insert a static trust anchor.
Represents an Interest packet.
TrustAnchorGroup & getGroup(const std::string &groupId) const
Get trusted anchor group.
represents a container for trust anchors.
A group of trust anchors.
Represents an absolute name.
void clear()
Remove all static or dynamic anchors.