represents the PIB More...
#include <pib.hpp>
Classes | |
class | Error |
represents a semantic error More... | |
Public Member Functions | |
~Pib () | |
std::string | getScheme () const |
return the scheme of the PIB Locator 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 IdentityContainer & | getIdentities () const |
Get all the identities. More... | |
const Identity & | getDefaultIdentity () const |
Get the default identity. More... | |
Identity | addIdentity (const Name &identity) |
Add an identity. More... | |
void | removeIdentity (const Name &identity) |
Remove an identity. More... | |
const Identity & | setDefaultIdentity (const Name &identity) |
Set an identity as the default identity. More... | |
shared_ptr< PibImpl > | getImpl () |
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< PibImpl > | impl |
Protected Attributes | |
std::string | m_scheme |
std::string | m_location |
bool | m_isDefaultIdentityLoaded |
Identity | m_defaultIdentity |
IdentityContainer | m_identities |
shared_ptr< PibImpl > | m_impl |
Friends | |
class | v2::KeyChain |
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.
PibImpl::Error | when underlying implementation has non-semantic error. |
|
default |
|
inline |
std::string ndn::security::pib::Pib::getPibLocator | ( | ) | const |
void ndn::security::pib::Pib::setTpmLocator | ( | const std::string & | tpmLocator | ) |
std::string ndn::security::pib::Pib::getTpmLocator | ( | ) | const |
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 setTpmLocator().
Get an identity with name identityName
.
Pib::Error | if 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.
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 nfd::rib::HostToGatewayReadvertisePolicy::handleNewRoute().
const Identity & ndn::security::pib::Pib::getDefaultIdentity | ( | ) | const |
Get the default identity.
Pib::Error | if no default identity exists. |
Definition at line 129 of file pib.cpp.
References ndn::security::pib::IdentityContainer::get(), ndn::security::pib::Identity::getName(), ndn::security::pib::IdentityContainer::isConsistent(), m_defaultIdentity, m_identities, m_impl, m_isDefaultIdentityLoaded, and NDN_LOG_DEBUG.
Add an identity.
If no default identity is set before, the new identity will be set as the default identity
Definition at line 80 of file pib.cpp.
References ndn::security::pib::IdentityContainer::add(), ndn::security::pib::IdentityContainer::isConsistent(), and m_identities.
void ndn::security::pib::Pib::removeIdentity | ( | const Name & | identity | ) |
Remove an identity.
If the default identity is being removed, no default identity will be selected.
Definition at line 88 of file pib.cpp.
References ndn::security::pib::Identity::getName(), ndn::security::pib::IdentityContainer::isConsistent(), m_defaultIdentity, m_identities, m_isDefaultIdentityLoaded, and ndn::security::pib::IdentityContainer::remove().
Set an identity as the default identity.
Create the identity if it does not exist.
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.
|
inline |
|
friend |
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE ndn::security::pib::Pib::__pad0__ |
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string& ndn::security::pib::Pib::location |
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string shared_ptr<PibImpl> ndn::security::pib::Pib::impl |
|
protected |
Definition at line 167 of file pib.hpp.
Referenced by getPibLocator(), and getScheme().
|
protected |
Definition at line 168 of file pib.hpp.
Referenced by getPibLocator().
|
mutableprotected |
Definition at line 170 of file pib.hpp.
Referenced by getDefaultIdentity(), removeIdentity(), reset(), and setDefaultIdentity().
|
mutableprotected |
Definition at line 171 of file pib.hpp.
Referenced by getDefaultIdentity(), removeIdentity(), and setDefaultIdentity().
|
protected |
Definition at line 173 of file pib.hpp.
Referenced by addIdentity(), getDefaultIdentity(), getIdentities(), getIdentity(), removeIdentity(), reset(), and setDefaultIdentity().
|
protected |
Definition at line 175 of file pib.hpp.
Referenced by getDefaultIdentity(), getImpl(), getTpmLocator(), reset(), setDefaultIdentity(), and setTpmLocator().