#include <dummy-keychain.hpp>
Classes | |
class | Error |
Public Member Functions | |
DummyPib (const std::string &locator) | |
void | setTpmLocator (const std::string &tpmLocator) override |
Set the corresponding TPM information to tpmLocator . More... | |
std::string | getTpmLocator () const override |
Get TPM Locator. More... | |
bool | hasIdentity (const Name &identityName) const override |
Check the existence of an identity. More... | |
void | addIdentity (const Name &identityName) override |
Add an identity. More... | |
void | removeIdentity (const Name &identity) override |
Remove an identity and related keys and certificates. More... | |
void | clearIdentities () override |
Erasing all certificates, keys, and identities. More... | |
std::set< Name > | getIdentities () const override |
Get the name of all the identities. More... | |
void | setDefaultIdentity (const Name &identityName) override |
Set an identity with name identityName as the default identity. More... | |
Name | getDefaultIdentity () const override |
Get the default identity. More... | |
bool | hasKey (const Name &keyName) const override |
Check the existence of a key with keyName . More... | |
void | addKey (const Name &identity, const Name &keyName, span< const uint8_t > key) override |
Add a key. More... | |
void | removeKey (const Name &keyName) override |
Remove a key with keyName and related certificates. More... | |
Buffer | getKeyBits (const Name &keyName) const override |
Get the key bits of a key with name keyName . More... | |
std::set< Name > | getKeysOfIdentity (const Name &identity) const override |
Get all the key names of an identity with name identity . More... | |
void | setDefaultKeyOfIdentity (const Name &identity, const Name &keyName) override |
Set an key with keyName as the default key of an identity with name identity . More... | |
Name | getDefaultKeyOfIdentity (const Name &identity) const override |
bool | hasCertificate (const Name &certName) const override |
Check the existence of a certificate with name certName . More... | |
void | addCertificate (const Certificate &certificate) override |
Add a certificate. More... | |
void | removeCertificate (const Name &certName) override |
Remove a certificate with name certName . More... | |
Certificate | getCertificate (const Name &certificateName) const override |
Get a certificate with name certName . More... | |
std::set< Name > | getCertificatesOfKey (const Name &keyName) const override |
Get a list of certificate names of a key with id keyName . More... | |
void | setDefaultCertificateOfKey (const Name &keyName, const Name &certName) override |
Set a cert with name certName as the default of a key with keyName . More... | |
Certificate | getDefaultCertificateOfKey (const Name &keyName) const override |
Public Member Functions inherited from ndn::security::pib::PibImpl | |
virtual | ~PibImpl ()=default |
Static Public Member Functions | |
static std::string | getScheme () |
Static Public Attributes | |
static const std::string | SCHEME = "pib-dummy" |
Definition at line 36 of file dummy-keychain.hpp.
|
explicit |
Definition at line 72 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Set the corresponding TPM information to tpmLocator
.
This method does not reset contents of the PIB
Implements ndn::security::pib::PibImpl.
Definition at line 77 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Get TPM Locator.
Implements ndn::security::pib::PibImpl.
Definition at line 83 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Check the existence of an identity.
identity | The name of the identity. |
Implements ndn::security::pib::PibImpl.
Definition at line 89 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
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. |
Implements ndn::security::pib::PibImpl.
Definition at line 95 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
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. |
Implements ndn::security::pib::PibImpl.
Definition at line 100 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Erasing all certificates, keys, and identities.
Implements ndn::security::pib::PibImpl.
Definition at line 105 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Get the name of all the identities.
Implements ndn::security::pib::PibImpl.
Definition at line 110 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Set an identity with name identityName
as the default identity.
identityName | The name for the default identity. |
Error | If identityName identity does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 118 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Get the default identity.
Pib::Error | no default identity. |
Implements ndn::security::pib::PibImpl.
Definition at line 123 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Check the existence of a key with keyName
.
Implements ndn::security::pib::PibImpl.
Definition at line 129 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
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. |
Implements ndn::security::pib::PibImpl.
Definition at line 135 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Remove a key with keyName
and related certificates.
If the key does not exist, do nothing.
Implements ndn::security::pib::PibImpl.
Definition at line 140 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
Get the key bits of a key with name keyName
.
Pib::Error | the key does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 145 of file dummy-keychain.cpp.
References ndn::io::BASE64.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
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.
Implements ndn::security::pib::PibImpl.
Definition at line 155 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Set an key with keyName
as the default key of an identity with name identity
.
Pib::Error | the key does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 163 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
identity
.Pib::Error | no default key or the identity does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 168 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Check the existence of a certificate with name certName
.
certName | The name of the certificate. |
Implements ndn::security::pib::PibImpl.
Definition at line 174 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
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. |
Implements ndn::security::pib::PibImpl.
Definition at line 180 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Remove a certificate with name certName
.
If the certificate does not exist, do nothing.
certName | The name of the certificate. |
Implements ndn::security::pib::PibImpl.
Definition at line 185 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Get a certificate with name certName
.
certName | The name of the certificate. |
Pib::Error | the certificate does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 190 of file dummy-keychain.cpp.
References ndn::io::BASE64.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
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.
Implements ndn::security::pib::PibImpl.
Definition at line 204 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
Set a cert with name certName
as the default of a key with keyName
.
Pib::Error | the certificate with name certName does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 212 of file dummy-keychain.cpp.
Referenced by ndn::security::DummyPib::Error::Error().
|
overridevirtual |
keyName
.Pib::Error | the default certificate does not exist. |
Implements ndn::security::pib::PibImpl.
Definition at line 217 of file dummy-keychain.cpp.
References ndn::io::BASE64.
Referenced by ndn::security::DummyPib::Error::Error().
|
static |
Definition at line 231 of file dummy-keychain.cpp.
References SCHEME.
Referenced by ndn::security::DummyPib::Error::Error(), and ndn::security::DummyTpm::Error::Error().
|
static |
Definition at line 128 of file dummy-keychain.hpp.
Referenced by getScheme().