22 #ifndef NDN_SECURITY_PIB_PIB_MEMORY_HPP 23 #define NDN_SECURITY_PIB_PIB_MEMORY_HPP 45 PibMemory(
const std::string& location =
"");
47 static const std::string&
84 addKey(
const Name& identity,
const Name& keyName,
const uint8_t* key,
size_t keyLen)
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, v2::Certificate> m_certs;
148 #endif // NDN_SECURITY_PIB_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.
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.
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.
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.