A PibKeyContainer is used to search/enumerate the keys of an identity.
More...
#include <pib-key-container.hpp>
|
| size_t | size () const |
| | Get the number of keys in the container. More...
|
| |
| 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. More...
|
| |
| void | remove (const Name &keyName) |
| | Remove the key with name keyName from the container, and its related certificates. More...
|
| |
| ptr_lib::shared_ptr< PibKey > | get (const Name &keyName) |
| | Get the key with name keyName from the container. More...
|
| |
ptr_lib::shared_ptr
< std::vector< Name > > | getKeyNames () const |
| | Get the names of all the keys in the container. More...
|
| |
| bool | isConsistent () const |
| | Check if the container is consistent with the backend storage. More...
|
| |
A PibKeyContainer is used to search/enumerate the keys of an identity.
(A PibKeyContainer object can only be created by PibIdentity.)
| ptr_lib::shared_ptr< PibKey > ndn::PibKeyContainer::add |
( |
const uint8_t * |
key, |
|
|
size_t |
keyLength, |
|
|
const Name & |
keyName |
|
) |
| |
Add a key with name keyName into the container.
If a key with the same name already exists, this replaces it.
- Parameters
-
| key | The array of encoded key bytes. |
| keyLength | The number of bytes in the key array. |
| keyName | The name of the key, which is copied. |
- Returns
- The PibKey object.
- Exceptions
-
| std::invalid_argument | if the name of the key does not match the identity name. |
| ptr_lib::shared_ptr< PibKey > ndn::PibKeyContainer::get |
( |
const Name & |
keyName | ) |
|
Get the key with name keyName from the container.
- Parameters
-
| keyName | The name of the key. |
- Returns
- The PibKey object.
- Exceptions
-
| std::invalid_argument | if keyName does not match the identity name. |
| Pib::Error | if the key does not exist. |
| ptr_lib::shared_ptr< std::vector< Name > > ndn::PibKeyContainer::getKeyNames |
( |
| ) |
const |
Get the names of all the keys in the container.
- Returns
- A new list of Name.
| bool ndn::PibKeyContainer::isConsistent |
( |
| ) |
const |
Check if the container is consistent with the backend storage.
- Returns
- True if the container is consistent, false otherwise.
- Note
- This method is heavy-weight and should be used in a debugging mode only.
| void ndn::PibKeyContainer::remove |
( |
const Name & |
keyName | ) |
|
Remove the key with name keyName from the container, and its related certificates.
If the key does not exist, do nothing.
- Parameters
-
| keyName | The name of the key. |
- Exceptions
-
| std::invalid_argument | if keyName does not match the identity name. |
| size_t ndn::PibKeyContainer::size |
( |
| ) |
const |
|
inline |
Get the number of keys in the container.
- Returns
- The number of keys.
The documentation for this class was generated from the following files: