Public Member Functions | List of all members
ndn::IdentityStorage Class Referenceabstract

IdentityStorage is a base class for the storage of identity, public keys and certificates. More...

#include <identity-storage.hpp>

Inheritance diagram for ndn::IdentityStorage:
ndn::BasicIdentityStorage ndn::MemoryIdentityStorage

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< IdentityCertificategetCertificate (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< IdentityCertificategetDefaultCertificate ()
 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...
 

Detailed Description

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.

Member Function Documentation

virtual void ndn::IdentityStorage::activateKey ( const Name keyName)
pure virtual

Activate a key.

If a key is marked as inactive, its private part will not be used in packet signing.

Parameters
keyNamename of the key

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::addCertificate ( const IdentityCertificate certificate)
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.

Parameters
certificateThe certificate to be added. This makes a copy of the certificate.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::addIdentity ( const Name identityName)
pure virtual

Add a new identity.

Do nothing if the identity already exists.

Parameters
identityNameThe identity name to be added.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::addKey ( const Name keyName,
KeyType  keyType,
const Blob publicKeyDer 
)
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.

Parameters
keyNameThe name of the public key to be added.
keyTypeType of the public key to be added.
publicKeyDerA blob of the public key DER to be added.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::deactivateKey ( const Name keyName)
pure virtual

Deactivate a key.

If a key is marked as inactive, its private part will not be used in packet signing.

Parameters
keyNamename of the key

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::deleteCertificateInfo ( const Name certificateName)
pure virtual

Delete a certificate.

Parameters
certificateNameThe certificate name.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::deleteIdentityInfo ( const Name identity)
pure virtual

Delete an identity and related public keys and certificates.

Parameters
identityThe identity name.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::deletePublicKeyInfo ( const Name keyName)
pure virtual

Delete a public key and related certificates.

Parameters
keyNameThe key name.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual bool ndn::IdentityStorage::doesCertificateExist ( const Name certificateName)
pure virtual

Check if the specified certificate already exists.

Parameters
certificateNameThe name of the certificate.
Returns
true if the certificate exists, otherwise false.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual bool ndn::IdentityStorage::doesIdentityExist ( const Name identityName)
pure virtual

Check if the specified identity already exists.

Parameters
identityNameThe identity name.
Returns
true if the identity exists, otherwise false.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual bool ndn::IdentityStorage::doesKeyExist ( const Name keyName)
pure virtual

Check if the specified key already exists.

Parameters
keyNameThe name of the key.
Returns
true if the key exists, otherwise false.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::getAllCertificateNamesOfKey ( const Name keyName,
std::vector< Name > &  nameList,
bool  isDefault 
)
pure virtual

Append all the certificate names of a particular key name to the nameList.

Parameters
keyNameThe key name to search for.
nameListAppend result names to nameList.
isDefaultIf true, add only the default certificate name. If false, add only the non-default certificate names.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::getAllIdentities ( std::vector< Name > &  nameList,
bool  isDefault 
)
pure virtual

Append all the identity names to the nameList.

Parameters
nameListAppend result names to nameList.
isDefaultIf true, add only the default identity name. If false, add only the non-default identity names.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::getAllKeyNamesOfIdentity ( const Name identityName,
std::vector< Name > &  nameList,
bool  isDefault 
)
pure virtual

Append all the key names of a particular identity to the nameList.

Parameters
identityNameThe identity name to search for.
nameListAppend result names to nameList.
isDefaultIf true, add only the default key name. If false, add only the non-default key names.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual ptr_lib::shared_ptr<IdentityCertificate> ndn::IdentityStorage::getCertificate ( const Name certificateName)
pure virtual

Get a certificate from the identity storage.

Parameters
certificateNameThe name of the requested certificate.
Returns
The requested certificate.
Exceptions
SecurityExceptionif the certificate doesn't exist.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

ptr_lib::shared_ptr< IdentityCertificate > ndn::IdentityStorage::getDefaultCertificate ( )
virtual

Get the certificate of the default identity.

Returns
The requested certificate. If not found, return a shared_ptr with a null pointer.
Name ndn::IdentityStorage::getDefaultCertificateNameForIdentity ( const Name identityName)

Get the default certificate name for the specified identity.

Parameters
identityNameThe identity name.
Returns
The default certificate name.
Exceptions
SecurityExceptionif the default key name for the identity is not set or the default certificate name for the key name is not set.
virtual Name ndn::IdentityStorage::getDefaultCertificateNameForKey ( const Name keyName)
pure virtual

Get the default certificate name for the specified key.

Parameters
keyNameThe key name.
Returns
The default certificate name.
Exceptions
SecurityExceptionif the default certificate name for the key name is not set.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual Name ndn::IdentityStorage::getDefaultIdentity ( )
pure virtual

Get the default identity.

Returns
The name of default identity.
Exceptions
SecurityExceptionif the default identity is not set.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual Name ndn::IdentityStorage::getDefaultKeyNameForIdentity ( const Name identityName)
pure virtual

Get the default key name for the specified identity.

Parameters
identityNameThe identity name.
Returns
The default key name.
Exceptions
SecurityExceptionif the default key name for the identity is not set.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual Blob ndn::IdentityStorage::getKey ( const Name keyName)
pure virtual

Get the public key DER blob from the identity storage.

Parameters
keyNameThe name of the requested public key.
Returns
The DER Blob.
Exceptions
SecurityExceptionif the key doesn't exist.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

Name ndn::IdentityStorage::getNewKeyName ( const Name identityName,
bool  useKsk 
)

Generate a name for a new key belonging to the identity.

Parameters
identityNameThe identity name.
useKskIf true, generate a KSK name, otherwise a DSK name.
Returns
The generated key name.
virtual bool ndn::IdentityStorage::revokeIdentity ( )
pure virtual

Revoke the identity.

Returns
true if the identity was revoked, false if not.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::setDefaultCertificateNameForKey ( const Name keyName,
const Name certificateName 
)
pure virtual

Set the default key name for the specified identity.

Parameters
keyNameThe key name.
certificateNameThe certificate name.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::setDefaultIdentity ( const Name identityName)
pure virtual

Set the default identity.

If the identityName does not exist, then clear the default identity so that getDefaultIdentity() throws an exception.

Parameters
identityNameThe default identity name.

Implemented in ndn::BasicIdentityStorage, and ndn::MemoryIdentityStorage.

virtual void ndn::IdentityStorage::setDefaultKeyNameForIdentity ( const Name keyName,
const Name identityNameCheck = Name() 
)
pure virtual

Set a key as the default key of an identity.

The identity name is inferred from keyName.

Parameters
keyNameThe 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.


The documentation for this class was generated from the following files: