23 #ifndef NDN_PIB_MEMORY_HPP
24 #define NDN_PIB_MEMORY_HPP
27 #include "pib-impl.hpp"
42 : hasDefaultIdentity_(false)
105 virtual std::set<Name>
149 (
const Name& identityName,
const Name& keyName,
const uint8_t* key,
177 virtual std::set<Name>
237 virtual ptr_lib::shared_ptr<CertificateV2>
249 virtual std::set<Name>
269 virtual ptr_lib::shared_ptr<CertificateV2>
277 std::string tpmLocator_;
279 bool hasDefaultIdentity_;
280 Name defaultIdentityName_;
282 std::set<Name> identityNames_;
285 std::map<Name, Name> defaultKeyNames_;
288 std::map<Name, Blob> keys_;
291 std::map<Name, Name> defaultCertificateNames_;
294 std::map<Name, ptr_lib::shared_ptr<CertificateV2>> certificates_;
virtual void addCertificate(const CertificateV2 &certificate)
Add the certificate.
Definition: pib-memory.cpp:200
virtual ptr_lib::shared_ptr< CertificateV2 > getCertificate(const Name &certificateName) const
Get the certificate with name certificateName.
Definition: pib-memory.cpp:228
virtual void removeIdentity(const Name &identityName)
Remove the identity and its related keys and certificates.
Definition: pib-memory.cpp:60
virtual void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
Definition: pib-memory.cpp:36
PibImpl is an abstract base class for the PIB implementation used by the Pib class.
Definition: pib-impl.hpp:37
virtual bool hasIdentity(const Name &identityName) const
Check for the existence of an identity.
Definition: pib-memory.cpp:42
virtual void setDefaultCertificateOfKey(const Name &keyName, const Name &certificateName)
Set the cert with name certificateName as the default for the key with keyName.
Definition: pib-memory.cpp:253
virtual Name getDefaultKeyOfIdentity(const Name &identityName) const
Get the name of the default key for the identity with name identityName.
Definition: pib-memory.cpp:183
virtual void removeCertificate(const Name &certificateName)
Remove the certificate with name certificateName.
Definition: pib-memory.cpp:217
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
virtual std::set< Name > getKeysOfIdentity(const Name &identityName) const
Get all the key names of the identity with the name identityName.
Definition: pib-memory.cpp:159
virtual void clearIdentities()
Erase all certificates, keys, and identities.
Definition: pib-memory.cpp:74
virtual Blob getKeyBits(const Name &keyName) const
Get the key bits of a key with name keyName.
Definition: pib-memory.cpp:146
PibMemory extends PibImpl and is used by the Pib class as an in-memory implementation of a PIB...
Definition: pib-memory.hpp:36
virtual Name getDefaultIdentity() const
Get the default identity.
Definition: pib-memory.cpp:102
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
virtual bool hasCertificate(const Name &certificateName) const
Check for the existence of a certificate with name certificateName.
Definition: pib-memory.cpp:194
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
virtual ptr_lib::shared_ptr< CertificateV2 > getDefaultCertificateOfKey(const Name &keyName) const
Get the default certificate for the key with eyName.
Definition: pib-memory.cpp:262
virtual void removeKey(const Name &keyName)
Remove the key with keyName and its related certificates.
Definition: pib-memory.cpp:132
virtual std::string getTpmLocator() const
Get the TPM Locator.
Definition: pib-memory.cpp:39
virtual void addIdentity(const Name &identityName)
Add the identity.
Definition: pib-memory.cpp:48
virtual bool hasKey(const Name &keyName) const
Check for the existence of a key with keyName.
Definition: pib-memory.cpp:112
virtual std::set< Name > getCertificatesOfKey(const Name &keyName) const
Get a list of certificate names of the key with id keyName.
Definition: pib-memory.cpp:239
virtual std::set< Name > getIdentities() const
Get the names of all the identities.
Definition: pib-memory.cpp:86
virtual void setDefaultKeyOfIdentity(const Name &identityName, const Name &keyName)
Set the key with keyName as the default key for the identity with name identityName.
Definition: pib-memory.cpp:173
PibMemory()
Create a default PibMemory with no values.
Definition: pib-memory.hpp:41
virtual void setDefaultIdentity(const Name &identityName)
Set the identity with the identityName as the default identity.
Definition: pib-memory.cpp:93
virtual void addKey(const Name &identityName, const Name &keyName, const uint8_t *key, size_t keyLength)
Add the key.
Definition: pib-memory.cpp:119