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< PibIdentity > | getIdentity (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 |
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.
| void ndn::Pib::getAllIdentityNames | ( | std::vector< Name > & | nameList | ) |
Append all the identity names to the nameList.
| nameList | Append a copy of each name to nameList. |
| ptr_lib::shared_ptr< PibIdentity > & ndn::Pib::getDefaultIdentity | ( | ) |
Get the default identity.
| Pib::Error | if there is no default identity. |
| ptr_lib::shared_ptr< PibIdentity > ndn::Pib::getIdentity | ( | const Name & | identityName | ) |
Get the identity with name identityName.
| identityName | The name of the identity. |
| Pib::Error | if the identity does not exist. |
|
inline |
Get the PIB locator.
|
inline |
Get the scheme of the PIB locator.
| string ndn::Pib::getTpmLocator | ( | ) |
Get the TPM Locator.
| Pib::Error | if 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.
1.8.6