23 #ifndef NDN_PIB_KEY_CONTAINER_HPP
24 #define NDN_PIB_KEY_CONTAINER_HPP
28 #include "pib-key.hpp"
31 class TestPibKeyContainer_Basic_Test;
32 class TestPibKeyContainer_Errors_Test;
49 size()
const {
return keyNames_.size(); }
61 ptr_lib::shared_ptr<PibKey>
62 add(
const uint8_t* key,
size_t keyLength,
const Name& keyName);
71 remove(
const Name& keyName);
80 ptr_lib::shared_ptr<PibKey>
81 get(
const Name& keyName);
87 ptr_lib::shared_ptr<std::vector<Name> >
102 friend TestPibKeyContainer_Basic_Test;
103 friend TestPibKeyContainer_Errors_Test;
112 (
const Name& identityName,
const ptr_lib::shared_ptr<PibImpl>& pibImpl);
119 std::set<Name> keyNames_;
121 std::map<Name, ptr_lib::shared_ptr<PibKeyImpl>> keys_;
123 ptr_lib::shared_ptr<PibImpl> pibImpl_;
bool isConsistent() const
Check if the container is consistent with the backend storage.
Definition: pib-key-container.cpp:107
ptr_lib::shared_ptr< PibKey > add(const uint8_t *key, size_t keyLength, const Name &keyName)
Add a key with name keyName into the container.
Definition: pib-key-container.cpp:43
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
PibIdentityImpl provides the backend implementation for PibIdentity.
Definition: pib-identity-impl.hpp:41
ptr_lib::shared_ptr< std::vector< Name > > getKeyNames() const
Get the names of all the keys in the container.
Definition: pib-key-container.cpp:93
A PibKeyContainer is used to search/enumerate the keys of an identity.
Definition: pib-key-container.hpp:42
size_t size() const
Get the number of keys in the container.
Definition: pib-key-container.hpp:49