23 #ifndef NDN_PIB_IMPL_HPP
24 #define NDN_PIB_IMPL_HPP
28 #include "../v2/certificate-v2.hpp"
45 class Error :
public std::runtime_error
48 Error(
const std::string& what)
49 : std::runtime_error(what)
113 virtual std::set<Name>
141 hasKey(
const Name& keyName)
const = 0;
157 (
const Name& identityName,
const Name& keyName,
const uint8_t* key,
158 size_t keyLength) = 0;
185 virtual std::set<Name>
245 virtual ptr_lib::shared_ptr<CertificateV2>
257 virtual std::set<Name>
277 virtual ptr_lib::shared_ptr<CertificateV2>
282 PibImpl(
const PibImpl& other);
283 PibImpl& operator=(
const PibImpl& other);
virtual std::set< Name > getKeysOfIdentity(const Name &identityName) const =0
Get all the key names of the identity with the name identityName.
virtual void setTpmLocator(const std::string &tpmLocator)=0
Set the corresponding TPM information to tpmLocator.
virtual void removeIdentity(const Name &identityName)=0
Remove the identity and its related keys and certificates.
PibImpl is an abstract base class for the PIB implementation used by the Pib class.
Definition: pib-impl.hpp:37
A PibImpl::Error extends runtime_error and represents a non-semantic error in PIB implementation proc...
Definition: pib-impl.hpp:45
virtual void setDefaultCertificateOfKey(const Name &keyName, const Name &certificateName)=0
Set the cert with name certificateName as the default for the key with keyName.
virtual void setDefaultIdentity(const Name &identityName)=0
Set the identity with the identityName as the default identity.
virtual void removeCertificate(const Name &certificateName)=0
Remove the certificate with name certificateName.
virtual void clearIdentities()=0
Erase all certificates, keys, and identities.
virtual void addKey(const Name &identityName, const Name &keyName, const uint8_t *key, size_t keyLength)=0
Add the key.
virtual ptr_lib::shared_ptr< CertificateV2 > getCertificate(const Name &certificateName) const =0
Get the certificate with name certificateName.
virtual void addCertificate(const CertificateV2 &certificate)=0
Add the certificate.
virtual bool hasIdentity(const Name &identityName) const =0
Check for the existence of an identity.
virtual std::set< Name > getCertificatesOfKey(const Name &keyName) const =0
Get a list of certificate names of the key with id keyName.
virtual void addIdentity(const Name &identityName)=0
Add the identity.
virtual Name getDefaultIdentity() const =0
Get the default identity.
virtual Blob getKeyBits(const Name &keyName) const =0
Get the key bits of a key with name keyName.
virtual std::string getTpmLocator() const =0
Get the TPM Locator.
virtual void setDefaultKeyOfIdentity(const Name &identityName, const Name &keyName)=0
Set the key with keyName as the default key for the identity with name identityName.
virtual bool hasKey(const Name &keyName) const =0
Check for the existence of a key with keyName.
virtual void removeKey(const Name &keyName)=0
Remove the key with keyName and its related certificates.
virtual ptr_lib::shared_ptr< CertificateV2 > getDefaultCertificateOfKey(const Name &keyName) const =0
Get the default certificate for the key with eyName.
virtual bool hasCertificate(const Name &certificateName) const =0
Check for the existence of a certificate with name certificateName.
virtual Name getDefaultKeyOfIdentity(const Name &identityName) const =0
Get the name of the default key for the identity with name identityName.
virtual std::set< Name > getIdentities() const =0
Get the names of all the identities.