NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::pib::KeyContainer Class Reference

Container of keys of an identity. More...

#include <key-container.hpp>

Inheritance diagram for ndn::security::pib::KeyContainer:
Collaboration diagram for ndn::security::pib::KeyContainer:

Classes

class  const_iterator
 

Public Types

typedef const_iterator iterator
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
const_iterator find (const Name &keyName) const
 
size_t size () const
 
Key add (const uint8_t *key, size_t keyLen, const Name &keyName)
 Add key of keyLen bytes with keyName into the container. More...
 
void remove (const Name &keyName)
 Remove a key with keyName from the container. More...
 
Key get (const Name &keyName) const
 Get a key with keyName from the container. More...
 
bool isConsistent () const
 Check if the container is consistent with the backend storage. More...
 
const std::set< Name > & getKeyNames () const
 
const std::unordered_map< Name, shared_ptr< detail::KeyImpl > > & getLoadedKeys () const
 

Public Attributes

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE __pad0__: KeyContainer(const Name& identity
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE shared_ptr< PibImplpibImpl
 

Friends

class detail::IdentityImpl
 

Detailed Description

Container of keys of an identity.

The container is used to search/enumerate keys of an identity. The container can be created only by detail::IdentityImpl.

Definition at line 47 of file key-container.hpp.

Member Typedef Documentation

◆ iterator

Member Function Documentation

◆ begin()

KeyContainer::const_iterator ndn::security::pib::KeyContainer::begin ( ) const

Definition at line 92 of file key-container.cpp.

◆ end()

KeyContainer::const_iterator ndn::security::pib::KeyContainer::end ( ) const

Definition at line 98 of file key-container.cpp.

◆ find()

KeyContainer::const_iterator ndn::security::pib::KeyContainer::find ( const Name keyName) const

Definition at line 104 of file key-container.cpp.

◆ size()

size_t ndn::security::pib::KeyContainer::size ( ) const

Definition at line 110 of file key-container.cpp.

◆ add()

Key ndn::security::pib::KeyContainer::add ( const uint8_t *  key,
size_t  keyLen,
const Name keyName 
)

Add key of keyLen bytes with keyName into the container.

Exceptions
std::invalid_argumentkeyName does not match the identity

If a key with the same name already exists, overwrite the key.

Definition at line 116 of file key-container.cpp.

References ndn::security::v2::extractIdentityFromKeyName(), get(), and ndn::Name::toUri().

Referenced by ndn::security::pib::detail::IdentityImpl::addKey().

◆ remove()

void ndn::security::pib::KeyContainer::remove ( const Name keyName)

Remove a key with keyName from the container.

Exceptions
std::invalid_argumentkeyName does not match the identity

Definition at line 130 of file key-container.cpp.

References ndn::security::v2::extractIdentityFromKeyName(), and ndn::Name::toUri().

Referenced by ndn::security::pib::detail::IdentityImpl::removeKey().

◆ get()

Key ndn::security::pib::KeyContainer::get ( const Name keyName) const

Get a key with keyName from the container.

Exceptions
std::invalid_argumentkeyName does not match the identity
Pib::Errorthe key does not exist

Definition at line 143 of file key-container.cpp.

References ndn::security::v2::extractIdentityFromKeyName(), and ndn::Name::toUri().

Referenced by add(), ndn::security::pib::detail::IdentityImpl::getDefaultKey(), ndn::security::pib::detail::IdentityImpl::getKey(), and ndn::security::pib::detail::IdentityImpl::setDefaultKey().

◆ isConsistent()

bool ndn::security::pib::KeyContainer::isConsistent ( ) const

◆ getKeyNames()

const std::set<Name>& ndn::security::pib::KeyContainer::getKeyNames ( ) const
inline

Definition at line 135 of file key-container.hpp.

◆ getLoadedKeys()

const std::unordered_map<Name, shared_ptr<detail::KeyImpl> >& ndn::security::pib::KeyContainer::getLoadedKeys ( ) const
inline

Definition at line 141 of file key-container.hpp.

Friends And Related Function Documentation

◆ detail::IdentityImpl

friend class detail::IdentityImpl
friend

Definition at line 154 of file key-container.hpp.

Member Data Documentation

◆ __pad0__

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE ndn::security::pib::KeyContainer::__pad0__

Definition at line 132 of file key-container.hpp.

◆ pibImpl

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE shared_ptr<PibImpl> ndn::security::pib::KeyContainer::pibImpl

Definition at line 132 of file key-container.hpp.


The documentation for this class was generated from the following files: