22 #ifndef NDN_CXX_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
23 #define NDN_CXX_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
28 #include <unordered_map>
45 using NameSet = std::set<Name>;
48 class const_iterator :
public boost::forward_iterator_helper<const_iterator, const Certificate>
56 BOOST_ASSERT(m_container !=
nullptr);
57 return m_container->
get(*m_it);
70 return lhs.equals(rhs);
76 , m_container(&container)
84 NameSet::const_iterator m_it;
96 return {m_certNames.begin(), *
this};
114 return m_certNames.empty();
123 return m_certNames.size();
146 get(
const Name& certName)
const;
164 mutable std::unordered_map<Name, Certificate> m_certs;
168 const Name m_keyName;
169 const shared_ptr<PibImpl> m_pib;
Represents an absolute name.
Represents an NDN certificate.
Certificate operator*() const
friend bool operator==(const const_iterator &lhs, const const_iterator &rhs) noexcept
const_iterator & operator++()
Container of certificates of a key.
const_iterator find(const Name &certName) const
bool empty() const noexcept
Check whether the container is empty.
Certificate get(const Name &certName) const
Return a certificate by name.
void remove(const Name &certName)
Remove a certificate with certName from the container.
const_iterator end() const noexcept
bool isConsistent() const
Check if the container is consistent with the backend storage.
void add(const Certificate &certificate)
Add certificate into the container.
size_t size() const noexcept
Return the number of certificates in the container.
const_iterator begin() const noexcept
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE