A frontend handle of an Identity. More...
#include <ndn-cxx/security/pib/identity.hpp>
Public Member Functions | |
Identity () | |
Default Constructor. More... | |
Identity (weak_ptr< detail::IdentityImpl > impl) | |
Create an Identity with a backend implementation impl . More... | |
const Key & | getDefaultKey () const |
Get the default key for this Identity. More... | |
Key | getKey (const Name &keyName) const |
Get a key with id keyName . More... | |
const KeyContainer & | getKeys () const |
Get all keys for this identity. More... | |
const Name & | getName () const |
Get the name of the identity. More... | |
operator bool () const | |
Friends | |
bool | operator!= (const Identity &, const Identity &) |
A frontend handle of an Identity.
Identity is at the top level in PIB's Identity-Key-Certificate hierarchy. An identity has a Name, and contains zero or more keys, at most one of which is set as the default key of this identity. Properties of a key can be accessed after obtaining a Key object.
Definition at line 47 of file identity.hpp.
|
default |
Default Constructor.
Identity created using this default constructor is just a place holder. It can obtain an actual instance from Pib::getIdentity(...). A typical usage would be for exception handling:
Identity id; try { id = pib.getIdentity(...); } catch (const Pib::Error&) { ... }
An Identity instance created using this constructor is invalid. Calling a member method on an invalid Identity instance may cause an std::domain_error.
|
explicit |
Create an Identity with a backend implementation impl
.
This method should only be used by IdentityContainer.
Definition at line 31 of file identity.cpp.
const Key & ndn::security::pib::Identity::getDefaultKey | ( | ) | const |
Get the default key for this Identity.
Pib::Error | the default key does not exist. |
Definition at line 79 of file identity.cpp.
Get a key with id keyName
.
std::invalid_argument | keyName does not match identity |
Pib::Error | the key does not exist. |
Definition at line 55 of file identity.cpp.
const KeyContainer & ndn::security::pib::Identity::getKeys | ( | ) | const |
Get all keys for this identity.
Definition at line 61 of file identity.cpp.
const Name & ndn::security::pib::Identity::getName | ( | ) | const |
Get the name of the identity.
Definition at line 37 of file identity.cpp.
|
explicit |
Definition at line 84 of file identity.cpp.
Definition at line 101 of file identity.cpp.