IdentityStorage is a base class for the storage of identity, public keys and certificates. More...
#include <identity-storage.hpp>
Public Member Functions | |
virtual | ~IdentityStorage () |
The virtual Destructor. | |
virtual bool | doesIdentityExist (const Name &identityName)=0 |
Check if the specified identity already exists. More... | |
virtual void | addIdentity (const Name &identityName)=0 |
Add a new identity. More... | |
virtual bool | revokeIdentity ()=0 |
Revoke the identity. More... | |
Name | getNewKeyName (const Name &identityName, bool useKsk) |
Generate a name for a new key belonging to the identity. More... | |
virtual bool | doesKeyExist (const Name &keyName)=0 |
Check if the specified key already exists. More... | |
virtual void | addKey (const Name &keyName, KeyType keyType, const Blob &publicKeyDer)=0 |
Add a public key to the identity storage. More... | |
virtual Blob | getKey (const Name &keyName)=0 |
Get the public key DER blob from the identity storage. More... | |
virtual void | activateKey (const Name &keyName)=0 |
Activate a key. More... | |
virtual void | deactivateKey (const Name &keyName)=0 |
Deactivate a key. More... | |
virtual bool | doesCertificateExist (const Name &certificateName)=0 |
Check if the specified certificate already exists. More... | |
virtual void | addCertificate (const IdentityCertificate &certificate)=0 |
Add a certificate to the identity storage. More... | |
virtual ptr_lib::shared_ptr< IdentityCertificate > | getCertificate (const Name &certificateName)=0 |
Get a certificate from the identity storage. More... | |
virtual Name | getDefaultIdentity ()=0 |
Get the default identity. More... | |
virtual Name | getDefaultKeyNameForIdentity (const Name &identityName)=0 |
Get the default key name for the specified identity. More... | |
Name | getDefaultCertificateNameForIdentity (const Name &identityName) |
Get the default certificate name for the specified identity. More... | |
virtual Name | getDefaultCertificateNameForKey (const Name &keyName)=0 |
Get the default certificate name for the specified key. More... | |
virtual void | getAllIdentities (std::vector< Name > &nameList, bool isDefault)=0 |
Append all the identity names to the nameList. More... | |
virtual void | getAllKeyNamesOfIdentity (const Name &identityName, std::vector< Name > &nameList, bool isDefault)=0 |
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)=0 |
Append all the certificate names of a particular key name to the nameList. More... | |
virtual void | setDefaultIdentity (const Name &identityName)=0 |
Set the default identity. More... | |
virtual void | setDefaultKeyNameForIdentity (const Name &keyName, const Name &identityNameCheck=Name())=0 |
Set a key as the default key of an identity. More... | |
virtual void | setDefaultCertificateNameForKey (const Name &keyName, const Name &certificateName)=0 |
Set the default key name for the specified identity. More... | |
virtual ptr_lib::shared_ptr< IdentityCertificate > | getDefaultCertificate () |
Get the certificate of the default identity. More... | |
virtual void | deleteCertificateInfo (const Name &certificateName)=0 |
Delete a certificate. More... | |
virtual void | deletePublicKeyInfo (const Name &keyName)=0 |
Delete a public key and related certificates. More... | |
virtual void | deleteIdentityInfo (const Name &identity)=0 |
Delete an identity and related public keys and certificates. More... | |
IdentityStorage is a base class for the storage of identity, public keys and certificates.
Private keys are stored in PrivateKeyStorage. This is an abstract base class. A subclass must implement the methods.
|
pure 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 |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Add a new identity.
Do nothing if the identity already exists.
identityName | The identity name to be added. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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 |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Delete a certificate.
certificateName | The certificate name. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Delete an identity and related public keys and certificates.
identity | The identity name. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Delete a public key and related certificates.
keyName | The key name. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Check if the specified certificate already exists.
certificateName | The name of the certificate. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Check if the specified identity already exists.
identityName | The identity name. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Check if the specified key already exists.
keyName | The name of the key. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Get a certificate from the identity storage.
certificateName | The name of the requested certificate. |
SecurityException | if the certificate doesn't exist. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
virtual |
Get the certificate of the default identity.
Get the default certificate name for the specified identity.
identityName | The identity name. |
SecurityException | if the default key name for the identity is not set or the default certificate name for the key name is not set. |
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Get the default identity.
SecurityException | if the default identity is not set. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
Generate a name for a new key belonging to the identity.
identityName | The identity name. |
useKsk | If true, generate a KSK name, otherwise a DSK name. |
|
pure virtual |
Revoke the identity.
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure virtual |
Set the default key name for the specified identity.
keyName | The key name. |
certificateName | The certificate name. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.
|
pure 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. |
Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.