22 #ifndef NDN_CXX_SECURITY_PIB_IMPL_PIB_MEMORY_HPP 23 #define NDN_CXX_SECURITY_PIB_IMPL_PIB_MEMORY_HPP 45 PibMemory(
const std::string& location =
"");
47 static const std::string&
84 addKey(
const Name& identity,
const Name& keyName, span<const uint8_t> key)
override;
124 std::string m_tpmLocator;
126 bool m_hasDefaultIdentity;
127 Name m_defaultIdentity;
129 std::set<Name> m_identities;
132 std::map<Name, Name> m_defaultKeys;
135 std::map<Name, Buffer> m_keys;
138 std::map<Name, Name> m_defaultCerts;
141 std::map<Name, Certificate> m_certs;
148 #endif // NDN_CXX_SECURITY_PIB_IMPL_PIB_MEMORY_HPP bool hasIdentity(const Name &identity) const override
Check the existence of an identity.
Copyright (c) 2011-2015 Regents of the University of California.
Name getDefaultKeyOfIdentity(const Name &identity) const override
void addCertificate(const Certificate &certificate) override
Add a certificate.
void clearIdentities() override
Erasing all certificates, keys, and identities.
static const std::string & getScheme()
void removeKey(const Name &keyName) override
Remove a key with keyName and related certificates.
void removeIdentity(const Name &identity) override
Remove an identity and related keys and certificates.
std::string getTpmLocator() const override
Get TPM Locator.
void setDefaultCertificateOfKey(const Name &keyName, const Name &certName) override
Set a cert with name certName as the default of a key with keyName.
std::set< Name > getIdentities() const override
Get the name of all the identities.
bool hasKey(const Name &keyName) const override
Check the existence of a key with keyName.
PibMemory(const std::string &location="")
Create memory based PIB backend.
void setTpmLocator(const std::string &tpmLocator) override
Set the corresponding TPM information to tpmLocator.
void setDefaultKeyOfIdentity(const Name &identity, const Name &keyName) override
Set an key with keyName as the default key of an identity with name identity.
Certificate getCertificate(const Name &certName) const override
Get a certificate with name certName.
void removeCertificate(const Name &certName) override
Remove a certificate with name certName.
Name getDefaultIdentity() const override
Get the default identity.
Represents an absolute name.
An in-memory implementation of Pib.
void setDefaultIdentity(const Name &identityName) override
Set an identity with name identityName as the default identity.
bool hasCertificate(const Name &certName) const override
Check the existence of a certificate with name certName.
void addIdentity(const Name &identity) override
Add an identity.
Buffer getKeyBits(const Name &keyName) const override
Get the key bits of a key with name keyName.
Certificate getDefaultCertificateOfKey(const Name &keyName) const override
void addKey(const Name &identity, const Name &keyName, span< const uint8_t > key) override
Add a key.
General-purpose automatically managed/resized buffer.
Abstract class of PIB implementation.
std::set< Name > getKeysOfIdentity(const Name &identity) const override
Get all the key names of an identity with name identity.
std::set< Name > getCertificatesOfKey(const Name &keyName) const override
Get a list of certificate names of a key with id keyName.