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

In general, a PIB (Public Information Base) stores the public portion of a user's cryptography keys. More...

#include <pib.hpp>

Classes

class  Error
 A Pib::Error extends runtime_error and represents a semantic error in PIB processing. More...
 

Public Member Functions

std::string getScheme () const
 Get the scheme of the PIB locator. More...
 
std::string getPibLocator () const
 Get the PIB locator. More...
 
void setTpmLocator (const std::string &tpmLocator)
 Set the corresponding TPM information to tpmLocator. More...
 
std::string getTpmLocator ()
 Get the TPM Locator. More...
 
ptr_lib::shared_ptr< PibIdentitygetIdentity (const Name &identityName)
 Get the identity with name identityName. More...
 
ptr_lib::shared_ptr
< PibIdentity > & 
getDefaultIdentity ()
 Get the default identity. More...
 
void getAllIdentityNames (std::vector< Name > &nameList)
 Append all the identity names to the nameList. More...
 

Friends

class KeyChain
 

Detailed Description

In general, a 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 PIB locator. A PIB is designed to work with a TPM (Trusted Platform Module) which stores private keys. There is a one-to-one association between a PIB and a TPM, and therefore the TPM locator 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, this Pib class provides access to identities, and allows setting a default identity. Properties of an identity (such as PibKey objects) can be accessed after obtaining a PibIdentity object. (Likewise, CertificateV2 objects can be obtained from a PibKey object.)

Note: A Pib instance is created and managed only by the KeyChain, and is returned by the KeyChain getPib() method.

Member Function Documentation

void ndn::Pib::getAllIdentityNames ( std::vector< Name > &  nameList)

Append all the identity names to the nameList.

Parameters
nameListAppend a copy of each name to nameList.
ptr_lib::shared_ptr< PibIdentity > & ndn::Pib::getDefaultIdentity ( )

Get the default identity.

Returns
The PibIdentity object.
Exceptions
Pib::Errorif there is no default identity.
ptr_lib::shared_ptr< PibIdentity > ndn::Pib::getIdentity ( const Name identityName)

Get the identity with name identityName.

Parameters
identityNameThe name of the identity.
Returns
The PibIdentity object.
Exceptions
Pib::Errorif the identity does not exist.
std::string ndn::Pib::getPibLocator ( ) const
inline

Get the PIB locator.

Returns
The PIB locator.
std::string ndn::Pib::getScheme ( ) const
inline

Get the scheme of the PIB locator.

Returns
The scheme string.
string ndn::Pib::getTpmLocator ( )

Get the TPM Locator.

Exceptions
Pib::Errorif the TPM locator is empty.
void ndn::Pib::setTpmLocator ( const std::string &  tpmLocator)

Set the corresponding TPM information to tpmLocator.

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


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