23 #ifndef NDN_TRUST_ANCHOR_CONTAINER_HPP
24 #define NDN_TRUST_ANCHOR_CONTAINER_HPP
27 #include "trust-anchor-group.hpp"
51 class Error :
public std::runtime_error
54 Error(
const std::string& what)
55 : std::runtime_error(what)
87 (
const std::string& groupId,
const std::string& path,
105 ptr_lib::shared_ptr<CertificateV2>
115 ptr_lib::shared_ptr<CertificateV2>
125 getGroup(
const std::string& groupId);
132 size()
const {
return anchors_.size(); }
153 remove(
const Name& certificateName);
159 clear() { anchorsByName_.clear(); }
166 size()
const {
return anchorsByName_.size(); }
169 friend class TrustAnchorContainer;
171 std::map<Name, ptr_lib::shared_ptr<CertificateV2> > anchorsByName_;
178 TrustAnchorContainer(
const TrustAnchorContainer& other);
179 TrustAnchorContainer& operator=(
const TrustAnchorContainer& other);
181 std::map<std::string, ptr_lib::shared_ptr<TrustAnchorGroup> > groups_;
182 AnchorContainer anchors_;
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
ptr_lib::shared_ptr< CertificateV2 > find(const Name &keyName) const
Search for a certificate across all groups (longest prefix match).
Definition: trust-anchor-container.cpp:67
void insert(const std::string &groupId, const CertificateV2 &certificate)
Insert a static trust anchor.
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:43
TrustAnchorGroup & getGroup(const std::string &groupId)
Get the trust anchor group for the groupId.
Definition: trust-anchor-container.cpp:97
size_t size() const
Get the number of trust anchors across all groups.
Definition: trust-anchor-container.hpp:132
void clear()
Remove all static and dynamic anchors.
Definition: trust-anchor-container.hpp:94
Definition: trust-anchor-container.hpp:51
Definition: trust-anchor-group.hpp:31
A TrustAnchorContainer represents a container for trust anchors.
Definition: trust-anchor-container.hpp:49
TrustAnchorGroup represents a group of trust anchors which implement the CertificateContainerInterfac...
Definition: trust-anchor-group.hpp:57