22 #ifndef NDN_SECURITY_V2_TRUST_ANCHOR_CONTAINER_HPP 23 #define NDN_SECURITY_V2_TRUST_ANCHOR_CONTAINER_HPP 27 #include "../../interest.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
63 :
std::runtime_error(what)
95 insert(
const std::string& groupId,
const boost::filesystem::path& path,
96 time::nanoseconds refreshPeriod,
bool isDir =
false);
133 getGroup(
const std::string& groupId)
const;
146 using AnchorContainerBase = boost::multi_index::multi_index_container<
148 boost::multi_index::indexed_by<
149 boost::multi_index::ordered_unique<
150 boost::multi_index::const_mem_fun<Data, const Name&, &Data::getName>
156 public AnchorContainerBase
160 add(Certificate&& cert)
final;
163 remove(
const Name& certName)
final;
169 using GroupContainer = boost::multi_index::multi_index_container<
170 shared_ptr<TrustAnchorGroup>,
171 boost::multi_index::indexed_by<
172 boost::multi_index::hashed_unique<
173 boost::multi_index::const_mem_fun<TrustAnchorGroup, const std::string&, &TrustAnchorGroup::getId>
178 GroupContainer m_groups;
179 AnchorContainer m_anchors;
186 #endif // NDN_SECURITY_V2_TRUST_ANCHOR_CONTAINER_HPP Copyright (c) 2013-2017 Regents of the University of California.
The certificate following the certificate format naming convention.
const Certificate * find(const Name &keyName) const
Search for certificate across all groups (longest prefix match)
Error(const std::string &what)
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.