All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | List of all members
ndn::PibImpl Class Referenceabstract

PibImpl is an abstract base class for the PIB implementation used by the Pib class. More...

#include <pib-impl.hpp>

Inheritance diagram for ndn::PibImpl:
ndn::PibMemory ndn::PibSqlite3

Classes

class  Error
 A PibImpl::Error extends runtime_error and represents a non-semantic error in PIB implementation processing. More...
 

Public Member Functions

virtual void setTpmLocator (const std::string &tpmLocator)=0
 Set the corresponding TPM information to tpmLocator. More...
 
virtual std::string getTpmLocator () const =0
 Get the TPM Locator. More...
 
virtual bool hasIdentity (const Name &identityName) const =0
 Check for the existence of an identity. More...
 
virtual void addIdentity (const Name &identityName)=0
 Add the identity. More...
 
virtual void removeIdentity (const Name &identityName)=0
 Remove the identity and its related keys and certificates. More...
 
virtual void clearIdentities ()=0
 Erase all certificates, keys, and identities.
 
virtual std::set< NamegetIdentities () const =0
 Get the names of all the identities. More...
 
virtual void setDefaultIdentity (const Name &identityName)=0
 Set the identity with the identityName as the default identity. More...
 
virtual Name getDefaultIdentity () const =0
 Get the default identity. More...
 
virtual bool hasKey (const Name &keyName) const =0
 Check for the existence of a key with keyName. More...
 
virtual void addKey (const Name &identityName, const Name &keyName, const uint8_t *key, size_t keyLength)=0
 Add the key. More...
 
virtual void removeKey (const Name &keyName)=0
 Remove the key with keyName and its related certificates. More...
 
virtual Blob getKeyBits (const Name &keyName) const =0
 Get the key bits of a key with name keyName. More...
 
virtual std::set< NamegetKeysOfIdentity (const Name &identityName) const =0
 Get all the key names of the identity with the name identityName. More...
 
virtual void setDefaultKeyOfIdentity (const Name &identityName, const Name &keyName)=0
 Set the key with keyName as the default key for the identity with name identityName. More...
 
virtual Name getDefaultKeyOfIdentity (const Name &identityName) const =0
 Get the name of the default key for the identity with name identityName. More...
 
virtual bool hasCertificate (const Name &certificateName) const =0
 Check for the existence of a certificate with name certificateName. More...
 
virtual void addCertificate (const CertificateV2 &certificate)=0
 Add the certificate. More...
 
virtual void removeCertificate (const Name &certificateName)=0
 Remove the certificate with name certificateName. More...
 
virtual ptr_lib::shared_ptr
< CertificateV2
getCertificate (const Name &certificateName) const =0
 Get the certificate with name certificateName. More...
 
virtual std::set< NamegetCertificatesOfKey (const Name &keyName) const =0
 Get a list of certificate names of the key with id keyName. More...
 
virtual void setDefaultCertificateOfKey (const Name &keyName, const Name &certificateName)=0
 Set the cert with name certificateName as the default for the key with keyName. More...
 
virtual ptr_lib::shared_ptr
< CertificateV2
getDefaultCertificateOfKey (const Name &keyName) const =0
 Get the default certificate for the key with eyName. More...
 

Detailed Description

PibImpl is an abstract base class for the PIB implementation used by the Pib class.

This class defines the interface that an actual PIB implementation should provide, for example PibMemory.

Member Function Documentation

virtual void ndn::PibImpl::addCertificate ( const CertificateV2 certificate)
pure virtual

Add the certificate.

If a certificate with the same name (without implicit digest) already exists, then overwrite the certificate. If the key or identity does not exist, they will be created. If no default certificate for the key has been set, then set the added certificate as the default for the key. If no default key was set for the identity, it will be set as the default key for the identity. If no default identity was selected, the certificate's identity becomes the default.

Parameters
certificateThe certificate to add. This copies the object.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

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

Add the identity.

If the identity already exists, do nothing. If no default identity has been set, set the added identity as the default.

Parameters
identityNameThe name of the identity to add. This copies the name.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::addKey ( const Name identityName,
const Name keyName,
const uint8_t *  key,
size_t  keyLength 
)
pure virtual

Add the 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 for the identity has been set, then set the added key as the default for the identity. If no default identity has been set, identity becomes the default.

Parameters
identityNameThe name of the identity that the key belongs to. This copies the name.
keyNameThe name of the key. This copies the name.
keyThe public key bits. This copies the array.
keyLengthThe length of the public key bits array.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual ptr_lib::shared_ptr<CertificateV2> ndn::PibImpl::getCertificate ( const Name certificateName) const
pure virtual

Get the certificate with name certificateName.

Parameters
certificateNameThe name of the certificate.
Returns
A copy of the certificate.
Exceptions
Pib::Errorif the certificate does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual std::set<Name> ndn::PibImpl::getCertificatesOfKey ( const Name keyName) const
pure virtual

Get a list of certificate names of the key with id keyName.

The returned certificate names can be used to create a PibCertificateContainer. With a certificate name and a backend implementation, one can obtain the certificate.

Parameters
keyNameThe name of the key.
Returns
The set of certificate names. The Name objects are fresh copies. If the key does not exist, return an empty set.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual ptr_lib::shared_ptr<CertificateV2> ndn::PibImpl::getDefaultCertificateOfKey ( const Name keyName) const
pure virtual

Get the default certificate for the key with eyName.

Parameters
keyNameThe name of the key.
Returns
A copy of the default certificate.
Exceptions
Pib::Errorif the default certificate does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual Name ndn::PibImpl::getDefaultIdentity ( ) const
pure virtual

Get the default identity.

Returns
The name of the default identity, as a fresh copy.
Exceptions
Pib::Errorfor no default identity.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual Name ndn::PibImpl::getDefaultKeyOfIdentity ( const Name identityName) const
pure virtual

Get the name of the default key for the identity with name identityName.

Parameters
identityNameThe name of the identity.
Returns
The name of the default key, as a fresh copy.
Exceptions
Pib::Errorif there is no default key or if the identity does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual std::set<Name> ndn::PibImpl::getIdentities ( ) const
pure virtual

Get the names of all the identities.

Returns
The set of identity names. The Name objects are fresh copies.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual Blob ndn::PibImpl::getKeyBits ( const Name keyName) const
pure virtual

Get the key bits of a key with name keyName.

Parameters
keyNameThe name of the key.
Returns
The key bits.
Exceptions
Pib::Errorif the key does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual std::set<Name> ndn::PibImpl::getKeysOfIdentity ( const Name identityName) const
pure virtual

Get all the key names of the identity with the name identityName.

The returned key names can be used to create a KeyContainer. With a key name and a backend implementation, one can create a Key front end instance.

Parameters
identityNameThe name of the identity.
Returns
The set of key names. The Name objects are fresh copies. If the identity does not exist, return an empty set.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual std::string ndn::PibImpl::getTpmLocator ( ) const
pure virtual

Get the TPM Locator.

Returns
The TPM locator string.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual bool ndn::PibImpl::hasCertificate ( const Name certificateName) const
pure virtual

Check for the existence of a certificate with name certificateName.

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

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual bool ndn::PibImpl::hasIdentity ( const Name identityName) const
pure virtual

Check for the existence of an identity.

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

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual bool ndn::PibImpl::hasKey ( const Name keyName) const
pure virtual

Check for the existence of a key with keyName.

Parameters
keyNameThe name of the key.
Returns
True if the key exists, otherwise false. Return false if the identity does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::removeCertificate ( const Name certificateName)
pure virtual

Remove the certificate with name certificateName.

If the certificate does not exist, do nothing.

Parameters
certificateNameThe name of the certificate.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::removeIdentity ( const Name identityName)
pure virtual

Remove the identity and its 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.

Parameters
identityNameThe name of the identity to remove.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::removeKey ( const Name keyName)
pure virtual

Remove the key with keyName and its related certificates.

If the key does not exist, do nothing.

Parameters
keyNameThe name of the key.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::setDefaultCertificateOfKey ( const Name keyName,
const Name certificateName 
)
pure virtual

Set the cert with name certificateName as the default for the key with keyName.

Parameters
keyNameThe name of the key.
certificateNameThe name of the certificate. This copies the name.
Exceptions
Pib::Errorif the certificate with name certificateName does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

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

Set the identity with the identityName as the default identity.

If the identity with identityName does not exist, then it will be created.

Parameters
identityNameThe name for the default identity. This copies the name.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::setDefaultKeyOfIdentity ( const Name identityName,
const Name keyName 
)
pure virtual

Set the key with keyName as the default key for the identity with name identityName.

Parameters
identityNameThe name of the identity.
keyNameThe name of the key. This copies the name.
Exceptions
Pib::Errorif the key does not exist.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.

virtual void ndn::PibImpl::setTpmLocator ( const std::string &  tpmLocator)
pure virtual

Set the corresponding TPM information to tpmLocator.

This method does not reset the contents of the PIB.

Parameters
tpmLocatorThe TPM locator string.

Implemented in ndn::PibSqlite3, and ndn::PibMemory.


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