ndn::security::pib::Pib Class Reference

Frontend to the Public Information Base. More...

#include <ndn-cxx/security/pib/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 ()
 
Identity getDefaultIdentity () const
 Return the default identity. More...
 
const IdentityContainergetIdentities () const
 Return all the identities. More...
 
Identity getIdentity (const Name &identityName) const
 Return an identity with name identityName. More...
 
const std::string & getPibLocator () const
 Return the PIB Locator. More...
 
std::string getTpmLocator () const
 Return the associated TPM Locator or an empty string if unset. More...
 
void reset ()
 Reset the contents of the PIB, including reset of the TPM Locator. More...
 
void setTpmLocator (const std::string &tpmLocator)
 Set the associated TPM information to tpmLocator. More...
 

Detailed Description

Frontend to the Public Information Base.

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. The properties of an identity can be accessed after obtaining an Identity object.

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

Definition at line 52 of file pib.hpp.

Constructor & Destructor Documentation

◆ ~Pib()

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

Member Function Documentation

◆ getDefaultIdentity()

Identity ndn::security::pib::Pib::getDefaultIdentity ( ) const

Return the default identity.

Exceptions
Pib::ErrorNo default identity exists.

Definition at line 116 of file pib.cpp.

◆ getIdentities()

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

Return all the identities.

Definition at line 96 of file pib.cpp.

◆ getIdentity()

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

Return an identity with name identityName.

Exceptions
Pib::ErrorThe desired identity does not exist.

Definition at line 89 of file pib.cpp.

◆ getPibLocator()

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

Return the PIB Locator.

Definition at line 68 of file pib.hpp.

◆ getTpmLocator()

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

Return the associated TPM Locator or an empty string if unset.

Definition at line 43 of file pib.cpp.

◆ reset()

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

Reset the contents of the PIB, including reset of the TPM Locator.

Definition at line 61 of file pib.cpp.

◆ setTpmLocator()

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

Set the associated TPM information to tpmLocator.

Note
If the provided tpmLocator differs from the current one, reset() is called.

Definition at line 49 of file pib.cpp.