All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Friends | List of all members
ndn::PibKeyContainer Class Reference

A PibKeyContainer is used to search/enumerate the keys of an identity. More...

#include <pib-key-container.hpp>

Public Member Functions

size_t size () const
 Get the number of keys in the container. More...
 
ptr_lib::shared_ptr< PibKeyadd (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< PibKeyget (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...
 

Friends

class PibIdentityImpl
 

Detailed Description

A PibKeyContainer is used to search/enumerate the keys of an identity.

(A PibKeyContainer object can only be created by PibIdentity.)

Member Function Documentation

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
keyThe array of encoded key bytes.
keyLengthThe number of bytes in the key array.
keyNameThe name of the key, which is copied.
Returns
The PibKey object.
Exceptions
std::invalid_argumentif 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
keyNameThe name of the key.
Returns
The PibKey object.
Exceptions
std::invalid_argumentif keyName does not match the identity name.
Pib::Errorif 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
keyNameThe name of the key.
Exceptions
std::invalid_argumentif 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: