23 #ifndef NDN_PIB_SQLITE3_HPP
24 #define NDN_PIB_SQLITE3_HPP
27 #define NDN_PIB_SQLITE3_SCHEME "pib-sqlite3"
30 #include "../../ndn-cpp-config.h"
31 #ifdef NDN_CPP_HAVE_SQLITE3
33 #include "pib-impl.hpp"
58 (
const std::string& databaseDirectoryPath =
"",
59 const std::string& databaseFilename =
"pib.db");
124 virtual std::set<Name>
168 (
const Name& identityName,
const Name& keyName,
const uint8_t* key,
196 virtual std::set<Name>
256 virtual ptr_lib::shared_ptr<CertificateV2>
268 virtual std::set<Name>
288 virtual ptr_lib::shared_ptr<CertificateV2>
312 hasDefaultIdentity()
const;
315 hasDefaultKeyOfIdentity(
const Name& identityName)
const;
318 hasDefaultCertificateOfKey(
const Name& keyName)
const;
324 struct sqlite3 *database_;
329 #endif // NDN_CPP_HAVE_SQLITE3
virtual void addCertificate(const CertificateV2 &certificate)
Add the certificate.
PibImpl is an abstract base class for the PIB implementation used by the Pib class.
Definition: pib-impl.hpp:37
virtual std::string getTpmLocator() const
Get the TPM Locator.
virtual bool hasIdentity(const Name &identityName) const
Check for the existence of an identity.
virtual ptr_lib::shared_ptr< CertificateV2 > getDefaultCertificateOfKey(const Name &keyName) const
Get the default certificate for the key with eyName.
virtual bool hasCertificate(const Name &certificateName) const
Check for the existence of a certificate with name certificateName.
virtual void addKey(const Name &identityName, const Name &keyName, const uint8_t *key, size_t keyLength)
Add the key.
virtual Name getDefaultKeyOfIdentity(const Name &identityName) const
Get the name of the default key for the identity with name identityName.
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
virtual ptr_lib::shared_ptr< CertificateV2 > getCertificate(const Name &certificateName) const
Get the certificate with name certificateName.
virtual void addIdentity(const Name &identityName)
Add the identity.
PibSqlite3 extends PibImpl and is used by the Pib class as an implementation of a PIB based on an SQL...
Definition: pib-sqlite3.hpp:45
PibSqlite3(const std::string &databaseDirectoryPath="", const std::string &databaseFilename="pib.db")
Create a new PibSqlite3 to work with an SQLite3 file.
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
virtual std::set< Name > getCertificatesOfKey(const Name &keyName) const
Get a list of certificate names of the key with id keyName.
virtual std::set< Name > getIdentities() const
Get the names of all the identities.
static std::string getDefaultDatabaseDirectoryPath()
Get the default that the constructor uses if databaseDirectoryPath is omitted.
virtual Blob getKeyBits(const Name &keyName) const
Get the key bits of a key with name keyName.
virtual void setDefaultIdentity(const Name &identityName)
Set the identity with the identityName as the default identity.
static std::string getDefaultDatabaseFilePath()
Get the default database file path that the constructor uses if databaseDirectoryPath and databaseFil...
Definition: pib-sqlite3.hpp:305
virtual void setDefaultKeyOfIdentity(const Name &identityName, const Name &keyName)
Set the key with keyName as the default key for the identity with name identityName.
virtual void removeIdentity(const Name &identityName)
Remove the identity and its related keys and certificates.
virtual bool hasKey(const Name &keyName) const
Check for the existence of a key with keyName.
virtual void removeCertificate(const Name &certificateName)
Remove the certificate with name certificateName.
virtual Name getDefaultIdentity() const
Get the default identity.
virtual void clearIdentities()
Erase all certificates, keys, and identities.
virtual void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
virtual void removeKey(const Name &keyName)
Remove the key with keyName and its related certificates.
virtual ~PibSqlite3()
Destroy and clean up the internal state.
virtual std::set< Name > getKeysOfIdentity(const Name &identityName) const
Get all the key names of the identity with the name identityName.
virtual void setDefaultCertificateOfKey(const Name &keyName, const Name &certificateName)
Set the cert with name certificateName as the default for the key with keyName.