22 #ifndef NDN_CXX_SECURITY_PIB_KEY_CONTAINER_HPP
23 #define NDN_CXX_SECURITY_PIB_KEY_CONTAINER_HPP
28 #include <unordered_map>
45 using NameSet = std::set<Name>;
48 class const_iterator :
public boost::forward_iterator_helper<const_iterator, const Key>
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_keyNames.begin(), *
this};
114 return m_keyNames.empty();
123 return m_keyNames.size();
134 add(span<const uint8_t> key,
const Name& keyName);
149 get(
const Name& keyName)
const;
167 mutable std::unordered_map<Name, shared_ptr<KeyImpl>> m_keys;
171 const Name m_identity;
172 const shared_ptr<PibImpl> m_pib;
Represents an absolute name.
friend bool operator==(const const_iterator &lhs, const const_iterator &rhs) noexcept
const_iterator & operator++()
Container of keys of an identity.
const_iterator end() const noexcept
size_t size() const noexcept
Return the number of keys in the container.
Key add(span< const uint8_t > key, const Name &keyName)
Add key with name keyName into the container.
Key get(const Name &keyName) const
Return a key by name.
const_iterator find(const Name &keyName) const
bool isConsistent() const
Check if the container is consistent with the backend storage.
friend class IdentityImpl
const_iterator begin() const noexcept
bool empty() const noexcept
Check whether the container is empty.
void remove(const Name &keyName)
Remove a key with keyName from the container.
Frontend handle for a key in the PIB.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE