PIB backend interface. More...
#include <ndn-cxx/security/pib/pib-impl.hpp>
Classes | |
class | Error |
Represents a non-semantic error. More... | |
Public Member Functions | |
virtual | ~PibImpl ()=default |
virtual void | addCertificate (const Certificate &certificate)=0 |
Add a certificate. More... | |
virtual void | addIdentity (const Name &identity)=0 |
Add an identity. More... | |
virtual void | addKey (const Name &identity, const Name &keyName, span< const uint8_t > key)=0 |
Add a key. More... | |
virtual void | clearIdentities ()=0 |
Erasing all certificates, keys, and identities. More... | |
virtual Certificate | getCertificate (const Name &certName) const =0 |
Get a certificate with name certName . More... | |
virtual std::set< Name > | getCertificatesOfKey (const Name &keyName) const =0 |
Get a list of certificate names of a key with id keyName . More... | |
virtual Certificate | getDefaultCertificateOfKey (const Name &keyName) const =0 |
virtual Name | getDefaultIdentity () const =0 |
Get the default identity. More... | |
virtual Name | getDefaultKeyOfIdentity (const Name &identity) const =0 |
virtual std::set< Name > | getIdentities () const =0 |
Get the name of all the identities. More... | |
virtual Buffer | getKeyBits (const Name &keyName) const =0 |
Get the key bits of a key with name keyName . More... | |
virtual std::set< Name > | getKeysOfIdentity (const Name &identity) const =0 |
Get all the key names of an identity with name identity . More... | |
virtual std::string | getTpmLocator () const =0 |
Return the associated TPM Locator or an empty string if unset. More... | |
virtual bool | hasCertificate (const Name &certName) const =0 |
Check the existence of a certificate with name certName . More... | |
virtual bool | hasIdentity (const Name &identity) const =0 |
Check the existence of an identity. More... | |
virtual bool | hasKey (const Name &keyName) const =0 |
Check the existence of a key with keyName . More... | |
virtual void | removeCertificate (const Name &certName)=0 |
Remove a certificate with name certName . More... | |
virtual void | removeIdentity (const Name &identity)=0 |
Remove an identity and related keys and certificates. More... | |
virtual void | removeKey (const Name &keyName)=0 |
Remove a key with keyName and related certificates. More... | |
virtual void | setDefaultCertificateOfKey (const Name &keyName, const Name &certName)=0 |
Set a cert with name certName as the default of a key with keyName . More... | |
virtual void | setDefaultIdentity (const Name &identityName)=0 |
Set an identity with name identityName as the default identity. More... | |
virtual void | setDefaultKeyOfIdentity (const Name &identity, const Name &keyName)=0 |
Set an key with keyName as the default key of an identity with name identity . More... | |
virtual void | setTpmLocator (const std::string &tpmLocator)=0 |
Set the associated TPM information to tpmLocator . More... | |
PIB backend interface.
This abstract class defines the interface that an actual PIB implementation (e.g., one based on sqlite3) must provide.
Definition at line 42 of file pib-impl.hpp.
|
virtualdefault |
|
pure virtual |
Add a certificate.
If a certificate with the same name (without implicit digest) already exists, overwrite the certificate. If the key or identity does not exist, they will be created. If no default certificate of the key has been set, set the added one as default certificate of the key. If no default key was set for the identity, it will be set as default key for the identity. If no default identity was selected, the certificate's identity becomes default.
certificate | The certificate to add. |
|
pure virtual |
Add an identity.
If the identity already exists, do nothing. If no default identity has been set, set the added one as default identity.
identity | The name of the identity to add. |
|
pure virtual |
Add a key.
If a key with the same name already exists, overwrite the key. If the identity does not exist, it will be created. If no default key of the identity has been set, set the added one as default key of the identity. If no default identity has been set, identity
becomes the default.
identity | The name of the identity that will own the added key. |
keyName | The key name. |
key | The public key bits. |
|
pure virtual |
Erasing all certificates, keys, and identities.
|
pure virtual |
Get a certificate with name certName
.
certName | The name of the certificate. |
Pib::Error | the certificate does not exist. |
|
pure virtual |
Get a list of certificate names of a key with id keyName
.
The returned certificate names can be used to create a CertificateContainer. With certificate name and backend implementation, one can obtain the certificate.
|
pure virtual |
keyName
.Pib::Error | the default certificate does not exist. |
|
pure virtual |
Get the default identity.
Pib::Error | no default identity. |
|
pure virtual |
identity
.Pib::Error | no default key or the identity does not exist. |
|
pure virtual |
Get the name of all the identities.
Get the key bits of a key with name keyName
.
Pib::Error | the key does not exist. |
|
pure virtual |
Get all the key names of an identity with name identity
.
The returned key names can be used to create a KeyContainer. With key name and backend implementation, one can create a Key frontend instance.
|
pure virtual |
Return the associated TPM Locator or an empty string if unset.
|
pure virtual |
Check the existence of a certificate with name certName
.
certName | The name of the certificate. |
|
pure virtual |
Check the existence of an identity.
identity | The name of the identity. |
|
pure virtual |
Check the existence of a key with keyName
.
|
pure virtual |
Remove a certificate with name certName
.
If the certificate does not exist, do nothing.
certName | The name of the certificate. |
|
pure virtual |
Remove an identity and related keys and certificates.
If the default identity is being removed, no default identity will be selected. If the identity does not exist, do nothing.
identity | The name of the identity to remove. |
|
pure virtual |
Remove a key with keyName
and related certificates.
If the key does not exist, do nothing.
|
pure virtual |
Set a cert with name certName
as the default of a key with keyName
.
Pib::Error | the certificate with name certName does not exist. |
|
pure virtual |
Set an identity with name identityName
as the default identity.
identityName | The name for the default identity. |
Error | If identityName identity does not exist. |
|
pure virtual |
Set an key with keyName
as the default key of an identity with name identity
.
Pib::Error | the key does not exist. |
|
pure virtual |
Set the associated TPM information to tpmLocator
.
This method does not reset the contents of the PIB.