BasicIdentityStorage extends IdentityStorage to implement a basic storage of identity, public keys and certificates using SQLite. More...
#include <basic-identity-storage.hpp>
Public Member Functions | |
BasicIdentityStorage (const std::string &databaseFilePath="") | |
Create a new BasicIdentityStorage to work with an SQLite file. More... | |
virtual | ~BasicIdentityStorage () |
The virtual Destructor. | |
virtual bool | doesIdentityExist (const Name &identityName) |
Check if the specified identity already exists. More... | |
virtual void | addIdentity (const Name &identityName) |
Add a new identity. More... | |
virtual bool | revokeIdentity () |
Revoke the identity. More... | |
virtual bool | doesKeyExist (const Name &keyName) |
Check if the specified key already exists. More... | |
virtual void | addKey (const Name &keyName, KeyType keyType, const Blob &publicKeyDer) |
Add a public key to the identity storage. More... | |
virtual Blob | getKey (const Name &keyName) |
Get the public key DER blob from the identity storage. More... | |
virtual void | activateKey (const Name &keyName) |
Activate a key. More... | |
virtual void | deactivateKey (const Name &keyName) |
Deactivate a key. More... | |
virtual bool | doesCertificateExist (const Name &certificateName) |
Check if the specified certificate already exists. More... | |
virtual void | addCertificate (const IdentityCertificate &certificate) |
Add a certificate to the identity storage. More... | |
virtual ptr_lib::shared_ptr< IdentityCertificate > | getCertificate (const Name &certificateName) |
Get a certificate from the identity storage. More... | |
virtual Name | getDefaultIdentity () |
Get the default identity. More... | |
virtual Name | getDefaultKeyNameForIdentity (const Name &identityName) |
Get the default key name for the specified identity. More... | |
virtual Name | getDefaultCertificateNameForKey (const Name &keyName) |
Get the default certificate name for the specified key. More... | |
virtual void | getAllIdentities (std::vector< Name > &nameList, bool isDefault) |
Append all the identity names to the nameList. More... | |
virtual void | getAllKeyNamesOfIdentity (const Name &identityName, std::vector< Name > &nameList, bool isDefault) |
Append all the key names of a particular identity to the nameList. More... | |
virtual void | getAllCertificateNamesOfKey (const Name &keyName, std::vector< Name > &nameList, bool isDefault) |
Append all the certificate names of a particular key name to the nameList. More... | |
virtual void | setDefaultIdentity (const Name &identityName) |
Set the default identity. More... | |
virtual void | setDefaultKeyNameForIdentity (const Name &keyName, const Name &identityNameCheck=Name()) |
Set a key as the default key of an identity. More... | |
virtual void | setDefaultCertificateNameForKey (const Name &keyName, const Name &certificateName) |
Set the default key name for the specified identity. More... | |
virtual void | deleteCertificateInfo (const Name &certificateName) |
Delete a certificate. More... | |
virtual void | deletePublicKeyInfo (const Name &keyName) |
Delete a public key and related certificates. More... | |
virtual void | deleteIdentityInfo (const Name &identity) |
Delete an identity and related public keys and certificates. More... | |
Public Member Functions inherited from ndn::IdentityStorage | |
virtual | ~IdentityStorage () |
The virtual Destructor. | |
Name | getNewKeyName (const Name &identityName, bool useKsk) |
Generate a name for a new key belonging to the identity. More... | |
Name | getDefaultCertificateNameForIdentity (const Name &identityName) |
Get the default certificate name for the specified identity. More... | |
virtual ptr_lib::shared_ptr< IdentityCertificate > | getDefaultCertificate () |
Get the certificate of the default identity. More... | |
BasicIdentityStorage extends IdentityStorage to implement a basic storage of identity, public keys and certificates using SQLite.
ndn::BasicIdentityStorage::BasicIdentityStorage | ( | const std::string & | databaseFilePath = "" | ) |
Create a new BasicIdentityStorage to work with an SQLite file.
databaseFilePath | (optional) The path of the SQLite file. If empty or omitted, use the default location. |
|
virtual |
Activate a key.
If a key is marked as inactive, its private part will not be used in packet signing.
keyName | name of the key |
Implements ndn::IdentityStorage.
|
virtual |
Add a certificate to the identity storage.
Also call addKey to ensure that the certificate key exists. If the certificate is already installed, don't replace it.
certificate | The certificate to be added. This makes a copy of the certificate. |
Implements ndn::IdentityStorage.
|
virtual |
Add a new identity.
Do nothing if the identity already exists.
identityName | The identity name to be added. |
Implements ndn::IdentityStorage.
|
virtual |
Add a public key to the identity storage.
Also call addIdentity to ensure that the identityName for the key exists. However, if the key already exists, do nothing.
keyName | The name of the public key to be added. |
keyType | Type of the public key to be added. |
publicKeyDer | A blob of the public key DER to be added. |
Implements ndn::IdentityStorage.
|
virtual |
Deactivate a key.
If a key is marked as inactive, its private part will not be used in packet signing.
keyName | name of the key |
Implements ndn::IdentityStorage.
|
virtual |
Delete a certificate.
certificateName | The certificate name. |
Implements ndn::IdentityStorage.
|
virtual |
Delete an identity and related public keys and certificates.
identity | The identity name. |
Implements ndn::IdentityStorage.
|
virtual |
Delete a public key and related certificates.
keyName | The key name. |
Implements ndn::IdentityStorage.
|
virtual |
Check if the specified certificate already exists.
certificateName | The name of the certificate. |
Implements ndn::IdentityStorage.
|
virtual |
Check if the specified identity already exists.
identityName | The identity name. |
Implements ndn::IdentityStorage.
|
virtual |
Check if the specified key already exists.
keyName | The name of the key. |
Implements ndn::IdentityStorage.
|
virtual |
Append all the certificate names of a particular key name to the nameList.
keyName | The key name to search for. |
nameList | Append result names to nameList. |
isDefault | If true, add only the default certificate name. If false, add only the non-default certificate names. |
Implements ndn::IdentityStorage.
|
virtual |
Append all the identity names to the nameList.
nameList | Append result names to nameList. |
isDefault | If true, add only the default identity name. If false, add only the non-default identity names. |
Implements ndn::IdentityStorage.
|
virtual |
Append all the key names of a particular identity to the nameList.
identityName | The identity name to search for. |
nameList | Append result names to nameList. |
isDefault | If true, add only the default key name. If false, add only the non-default key names. |
Implements ndn::IdentityStorage.
|
virtual |
Get a certificate from the identity storage.
certificateName | The name of the requested certificate. |
SecurityException | if the certificate doesn't exist. |
Implements ndn::IdentityStorage.
|
virtual |
Get the default certificate name for the specified key.
keyName | The key name. |
SecurityException | if the default certificate name for the key name is not set. |
Implements ndn::IdentityStorage.
|
virtual |
Get the default identity.
SecurityException | if the default identity is not set. |
Implements ndn::IdentityStorage.
|
virtual |
Get the default key name for the specified identity.
identityName | The identity name. |
SecurityException | if the default key name for the identity is not set. |
Implements ndn::IdentityStorage.
Get the public key DER blob from the identity storage.
keyName | The name of the requested public key. |
SecurityException | if the key doesn't exist. |
Implements ndn::IdentityStorage.
|
virtual |
Revoke the identity.
Implements ndn::IdentityStorage.
|
virtual |
Set the default key name for the specified identity.
keyName | The key name. |
certificateName | The certificate name. |
Implements ndn::IdentityStorage.
|
virtual |
Set the default identity.
If the identityName does not exist, then clear the default identity so that getDefaultIdentity() throws an exception.
identityName | The default identity name. |
Implements ndn::IdentityStorage.
|
virtual |
Set a key as the default key of an identity.
The identity name is inferred from keyName.
keyName | The name of the key. |
identityNameCheck | (optional) The identity name to check that the keyName contains the same identity name. If an empty name, it is ignored. |
Implements ndn::IdentityStorage.