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

represents the PIB More...

#include <pib.hpp>

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

Classes

class  Error
 represents a semantic error More...
 

Public Member Functions

 ~Pib ()
 
std::string getScheme () const
 return the scheme of the PibLocator More...
 
std::string getPibLocator () const
 Get PIB Locator. More...
 
void setTpmLocator (const std::string &tpmLocator)
 Set the corresponding TPM information to tpmLocator. More...
 
std::string getTpmLocator () const
 Get TPM Locator. More...
 
void reset ()
 Reset content in PIB, including reset of the TPM locator. More...
 
Identity getIdentity (const Name &identityName) const
 Get an identity with name identityName. More...
 
const IdentityContainergetIdentities () const
 Get all the identities. More...
 
const IdentitygetDefaultIdentity () const
 Get the default identity. More...
 
Identity addIdentity (const Name &identity)
 Add an identity. More...
 
void removeIdentity (const Name &identity)
 
const IdentitysetDefaultIdentity (const Name &identity)
 Set an identity as the default identity. More...
 
shared_ptr< PibImplgetImpl ()
 

Public Attributes

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE __pad0__: Pib(const std::string& scheme
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string & location
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string shared_ptr< PibImplimpl
 

Protected Attributes

std::string m_scheme
 
std::string m_location
 
bool m_isDefaultIdentityLoaded
 
Identity m_defaultIdentity
 
IdentityContainer m_identities
 
shared_ptr< PibImplm_impl
 

Friends

class v2::KeyChain
 

Detailed Description

represents the PIB

The PIB (Public Information Base) stores the public portion of a user's cryptography keys. The format and location of stored information is indicated by the PibLocator. The PIB is designed to work with a TPM (Trusted Platform Module) which stores private keys. There is a one-to-one association between PIB and TPM, and therefore the TpmLocator is recorded by the PIB to enforce this association and prevent one from operating on mismatched PIB and TPM.

Information in the PIB is organized in a hierarchy of Identity-Key-Certificate. At the top level, the Pib class provides access to identities, and allows setting a default identity. Properties of an identity can be accessed after obtaining an Identity object.

Note
Pib instance is created and managed only by v2::KeyChain. v2::KeyChain::getPib() returns a const reference to the managed Pib instance, through which it is possible to retrieve information about identities, keys, and certificates.
Exceptions
PibImpl::Errorwhen underlying implementation has non-semantic error.

Definition at line 52 of file pib.hpp.

Constructor & Destructor Documentation

ndn::security::pib::Pib::~Pib ( )
default

Member Function Documentation

std::string ndn::security::pib::Pib::getScheme ( ) const
inline
std::string ndn::security::pib::Pib::getPibLocator ( ) const

Get PIB Locator.

Definition at line 45 of file pib.cpp.

References m_location, and m_scheme.

Referenced by getScheme().

void ndn::security::pib::Pib::setTpmLocator ( const std::string &  tpmLocator)

Set the corresponding TPM information to tpmLocator.

If the provided tpmLocator is different from the existing one, PIB will be reset. Otherwise, nothing will be changed.

Definition at line 51 of file pib.cpp.

References m_impl, and reset().

Referenced by getScheme().

std::string ndn::security::pib::Pib::getTpmLocator ( ) const

Get TPM Locator.

Exceptions
Errorif TPM locator is empty

Definition at line 61 of file pib.cpp.

References m_impl.

Referenced by getScheme().

void ndn::security::pib::Pib::reset ( )

Reset content in PIB, including reset of the TPM locator.

Definition at line 71 of file pib.cpp.

References m_identities, m_impl, m_isDefaultIdentityLoaded, and ndn::security::pib::IdentityContainer::reset().

Referenced by getScheme(), and setTpmLocator().

Identity ndn::security::pib::Pib::getIdentity ( const Name identityName) const

Get an identity with name identityName.

Exceptions
Pib::Errorif the identity does not exist.

Definition at line 100 of file pib.cpp.

References ndn::security::pib::IdentityContainer::get(), ndn::security::pib::IdentityContainer::isConsistent(), and m_identities.

Referenced by getScheme().

const IdentityContainer & ndn::security::pib::Pib::getIdentities ( ) const

Get all the identities.

Definition at line 108 of file pib.cpp.

References ndn::security::pib::IdentityContainer::isConsistent(), and m_identities.

Referenced by getScheme().

const Identity & ndn::security::pib::Pib::getDefaultIdentity ( ) const
Identity ndn::security::pib::Pib::addIdentity ( const Name identity)

Add an identity.

If no default identity is set before, the new identity will be set as the default identity

Returns
handle of the added identity.

Definition at line 80 of file pib.cpp.

References ndn::security::pib::IdentityContainer::add(), ndn::security::pib::IdentityContainer::isConsistent(), and m_identities.

const Identity & ndn::security::pib::Pib::setDefaultIdentity ( const Name identity)

Set an identity as the default identity.

Create the identity if it does not exist.

Returns
handle of the default identity

Definition at line 116 of file pib.cpp.

References ndn::security::pib::IdentityContainer::add(), ndn::security::pib::IdentityContainer::isConsistent(), m_defaultIdentity, m_identities, m_impl, m_isDefaultIdentityLoaded, and NDN_LOG_DEBUG.

shared_ptr<PibImpl> ndn::security::pib::Pib::getImpl ( )
inline

Definition at line 172 of file pib.hpp.

References m_impl.

Friends And Related Function Documentation

friend class v2::KeyChain
friend

Definition at line 188 of file pib.hpp.

Member Data Documentation

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE ndn::security::pib::Pib::__pad0__

Definition at line 132 of file pib.hpp.

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string& ndn::security::pib::Pib::location

Definition at line 132 of file pib.hpp.

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string shared_ptr<PibImpl> ndn::security::pib::Pib::impl

Definition at line 132 of file pib.hpp.

std::string ndn::security::pib::Pib::m_scheme
protected

Definition at line 178 of file pib.hpp.

Referenced by getPibLocator(), and getScheme().

std::string ndn::security::pib::Pib::m_location
protected

Definition at line 179 of file pib.hpp.

Referenced by getPibLocator().

bool ndn::security::pib::Pib::m_isDefaultIdentityLoaded
mutableprotected

Definition at line 181 of file pib.hpp.

Referenced by getDefaultIdentity(), removeIdentity(), reset(), and setDefaultIdentity().

Identity ndn::security::pib::Pib::m_defaultIdentity
mutableprotected

Definition at line 182 of file pib.hpp.

Referenced by getDefaultIdentity(), removeIdentity(), and setDefaultIdentity().

IdentityContainer ndn::security::pib::Pib::m_identities
protected
shared_ptr<PibImpl> ndn::security::pib::Pib::m_impl
protected

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