32 Pib::Pib(
const std::string& scheme,
const std::string& location, shared_ptr<PibImpl> impl)
34 , m_location(location)
35 , m_isDefaultIdentityLoaded(false)
37 , m_impl(std::move(impl))
39 BOOST_ASSERT(m_impl !=
nullptr);
53 if (tpmLocator ==
m_impl->getTpmLocator()) {
57 m_impl->setTpmLocator(tpmLocator);
63 std::string tpmLocator =
m_impl->getTpmLocator();
64 if (tpmLocator.empty()) {
65 BOOST_THROW_EXCEPTION(
Pib::Error(
"TPM info does not exist"));
122 NDN_LOG_DEBUG(
"Default identity is set to " << identityName);
124 m_impl->setDefaultIdentity(identityName);
Identity get(const Name &identity) const
Get identity from the container.
void remove(const Name &identity)
Remove identity from the container.
Copyright (c) 2011-2015 Regents of the University of California.
represents a semantic error
void reset()
Reset state of the container.
bool m_isDefaultIdentityLoaded
#define NDN_LOG_DEBUG(expression)
void removeIdentity(const Name &identity)
Remove an identity.
void reset()
Reset content in PIB, including reset of the TPM locator.
const IdentityContainer & getIdentities() const
Get all the identities.
shared_ptr< PibImpl > m_impl
void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
Identity add(const Name &identityName)
Add identity into the container.
IdentityContainer m_identities
Identity getIdentity(const Name &identityName) const
Get an identity with name identityName.
const Identity & setDefaultIdentity(const Name &identity)
Set an identity as the default identity.
Represents an absolute name.
Identity addIdentity(const Name &identity)
Add an identity.
std::string getPibLocator() const
Get PIB Locator.
const Identity & getDefaultIdentity() const
Get the default identity.
const Name & getName() const
Get the name of the identity.
Container of identities of a Pib.
bool isConsistent() const
Check if the container is consistent with the backend storage.
A frontend handle of an Identity.
#define NDN_LOG_INIT(name)
declare a log module
std::string getTpmLocator() const
Get TPM Locator.
Identity m_defaultIdentity