32 Pib::Pib(
const std::string& scheme,
const std::string& location, shared_ptr<PibImpl> impl)
34 , m_location(location)
35 , m_isDefaultIdentityLoaded(false)
39 BOOST_ASSERT(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);
void remove(const Name &identity)
Remove identity from the container.
Copyright (c) 2011-2015 Regents of the University of California.
represents a semantic error
std::string getTpmLocator() const
Get TPM Locator.
void reset()
Reset state of the container.
bool m_isDefaultIdentityLoaded
void removeIdentity(const Name &identity)
std::string getPibLocator() const
Get PIB Locator.
void reset()
Reset content in PIB, including reset of the TPM locator.
shared_ptr< PibImpl > m_impl
void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
Catch-all error for security policy errors that don't fit in other categories.
#define NDN_LOG_INIT(name)
declare a log module
Identity add(const Name &identityName)
Add identity into the container.
#define NDN_LOG_DEBUG(expression)
IdentityContainer m_identities
Identity get(const Name &identity) const
Get identity from the container.
bool isConsistent() const
Check if the container is consistent with the backend storage.
const Identity & setDefaultIdentity(const Name &identity)
Set an identity as the default identity.
const IdentityContainer & getIdentities() const
Get all the identities.
Represents an absolute name.
Identity addIdentity(const Name &identity)
Add an identity.
const Identity & getDefaultIdentity() const
Get the default identity.
Container of identities of a Pib.
const Name & getName() const
Get the name of the identity.
A frontend handle of an Identity.
Identity getIdentity(const Name &identityName) const
Get an identity with name identityName.
Identity m_defaultIdentity