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);
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;
160 using GroupContainer =
boost::multi_index::multi_index_container<
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;
177 #endif // NDN_SECURITY_V2_TRUST_ANCHOR_CONTAINER_HPP
Copyright (c) 2013-2016 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)
Copyright (c) 2013-2016 Regents of the University of California.
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.
Name abstraction to represent an absolute name.