All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
ndn::PibKey Class Reference

The PibKey class provides access to a key at the second level in the PIB's Identity-Key-Certificate hierarchy. More...

#include <pib-key.hpp>

Public Member Functions

const NamegetName ()
 
const NamegetIdentityName ()
 Get the name of the identity this key belongs to. More...
 
KeyType getKeyType ()
 Get the key type. More...
 
const BlobgetPublicKey ()
 Get the public key encoding. More...
 
ptr_lib::shared_ptr
< CertificateV2
getCertificate (const Name &certificateName)
 Get the certificate with name certificateName. More...
 
ptr_lib::shared_ptr
< CertificateV2 > & 
getDefaultCertificate ()
 Get the default certificate for this Key. More...
 

Static Public Member Functions

static Name constructKeyName (const Name &identityName, const Name::Component &keyId)
 Construct a key name based on the appropriate naming conventions. More...
 
static bool isValidKeyName (const Name &keyName)
 Check if keyName follows the naming conventions for a key name. More...
 
static Name extractIdentityFromKeyName (const Name &keyName)
 Extract the identity namespace from keyName. More...
 

Friends

class PibKeyContainer
 
class KeyChain
 

Detailed Description

The PibKey class provides access to a key at the second level in the PIB's Identity-Key-Certificate hierarchy.

A PibKey object has a Name (identity + "KEY" + keyId), and contains one or more CertificateV2 objects, one of which is set as the default certificate of this key. A certificate can be directly accessed by getting a CertificateV2 object.

Member Function Documentation

Name ndn::PibKey::constructKeyName ( const Name identityName,
const Name::Component keyId 
)
static

Construct a key name based on the appropriate naming conventions.

Parameters
identityNameThe name of the identity.
keyIdThe key ID name component.
Returns
The constructed name as a new Name.
Name ndn::PibKey::extractIdentityFromKeyName ( const Name keyName)
static

Extract the identity namespace from keyName.

Parameters
keyNameThe name of the key.
Returns
The identity name as a new Name.
ptr_lib::shared_ptr< CertificateV2 > ndn::PibKey::getCertificate ( const Name certificateName)

Get the certificate with name certificateName.

Parameters
certificateNameThe name of the certificate.
Returns
A copy of the CertificateV2 object.
Exceptions
std::domain_errorif the backend implementation instance is invalid.
std::invalid_argumentif certificateName does not match the key name.
Pib::Errorif the certificate does not exist.
ptr_lib::shared_ptr< CertificateV2 > & ndn::PibKey::getDefaultCertificate ( )

Get the default certificate for this Key.

Returns
A copy of the default certificate.
Exceptions
std::domain_errorif the backend implementation instance is invalid.
Pib::Errorif the default certificate does not exist.
const Name & ndn::PibKey::getIdentityName ( )

Get the name of the identity this key belongs to.

Returns
The name of the identity.
Exceptions
std::domain_errorif the backend implementation instance is invalid.
KeyType ndn::PibKey::getKeyType ( )

Get the key type.

Returns
The key type.
Exceptions
std::domain_errorif the backend implementation instance is invalid.
const Blob & ndn::PibKey::getPublicKey ( )

Get the public key encoding.

Returns
The public key encoding.
Exceptions
std::domain_errorif the backend implementation instance is invalid.
bool ndn::PibKey::isValidKeyName ( const Name keyName)
static

Check if keyName follows the naming conventions for a key name.

Parameters
keyNameThe name of the key.
Returns
True if keyName follows the naming conventions, otherwise false.

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