22 #ifndef NDN_SECURITY_PIB_PIB_MEMORY_HPP 23 #define NDN_SECURITY_PIB_PIB_MEMORY_HPP 56 PibMemory(
const std::string& location =
"");
58 static const std::string&
95 addKey(
const Name& identity,
const Name& keyName,
const uint8_t* key,
size_t keyLen)
override;
135 std::string m_tpmLocator;
137 bool m_hasDefaultIdentity;
138 Name m_defaultIdentity;
140 std::set<Name> m_identities;
143 std::map<Name, Name> m_defaultKeys;
146 std::map<Name, Buffer> m_keys;
149 std::map<Name, Name> m_defaultCerts;
152 std::map<Name, v2::Certificate> m_certs;
159 #endif // NDN_SECURITY_PIB_PIB_MEMORY_HPP bool hasIdentity(const Name &identity) const override
Check the existence of an identity.
represents a non-semantic error
Copyright (c) 2011-2015 Regents of the University of California.
The certificate following the certificate format naming convention.
Name getDefaultKeyOfIdentity(const Name &identity) const override
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.
void addCertificate(const v2::Certificate &certificate) override
Add a certificate.
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.
Catch-all error for security policy errors that don't fit in other categories.
void setDefaultKeyOfIdentity(const Name &identity, const Name &keyName) override
Set an key with keyName as the default key of an identity with name identity.
void removeCertificate(const Name &certName) override
Remove a certificate with name certName.
Name getDefaultIdentity() const override
Get the default identity.
void addKey(const Name &identity, const Name &keyName, const uint8_t *key, size_t keyLen) override
Add a key.
Represents an absolute name.
An in-memory implementation of Pib.
v2::Certificate getCertificate(const Name &certName) const override
Get a certificate with name certName.
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.
Error(const std::string &what)
v2::Certificate getDefaultCertificateOfKey(const Name &keyName) const override
Buffer getKeyBits(const Name &keyName) const override
Get the key bits of a key with name keyName.
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.