Frontend handle for an identity in the PIB. More...
#include <ndn-cxx/security/pib/identity.hpp>
Public Member Functions | |
Identity () noexcept | |
Default constructor. More... | |
Key | getDefaultKey () const |
Return the default key for this identity. More... | |
Key | getKey (const Name &keyName) const |
Obtain a handle to the key with the given name. More... | |
const KeyContainer & | getKeys () const |
Return all the keys of this identity. More... | |
const Name & | getName () const |
Return the name of the identity. More... | |
operator bool () const noexcept | |
Returns true if the instance is valid. More... | |
Friends | |
bool | operator!= (const Identity &lhs, const Identity &rhs) |
std::ostream & | operator<< (std::ostream &os, const Identity &id) |
bool | operator== (const Identity &lhs, const Identity &rhs) |
Frontend handle for an identity in the PIB.
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 that identity. The properties of a key can be accessed after obtaining a Key object.
Definition at line 49 of file identity.hpp.
|
defaultnoexcept |
Default constructor.
An Identity created using this default constructor is just a placeholder. You can obtain an actual instance from Pib::getIdentity(). A typical usage would be for exception handling:
An instance created using this constructor is invalid. Calling a member function on an invalid Identity instance may throw an std::domain_error.
Key ndn::security::pib::Identity::getDefaultKey | ( | ) | const |
Return the default key for this identity.
Pib::Error | the default key does not exist. |
Definition at line 79 of file identity.cpp.
Obtain a handle to the key with the given name.
std::invalid_argument | keyName does not match the identity. |
Pib::Error | the key does not exist. |
Definition at line 55 of file identity.cpp.
const KeyContainer & ndn::security::pib::Identity::getKeys | ( | ) | const |
Return all the keys of this identity.
Definition at line 61 of file identity.cpp.
const Name & ndn::security::pib::Identity::getName | ( | ) | const |
Return the name of the identity.
Definition at line 37 of file identity.cpp.
|
explicitnoexcept |
Returns true if the instance is valid.
Definition at line 84 of file identity.cpp.
Definition at line 171 of file identity.hpp.
|
friend |
Definition at line 176 of file identity.hpp.
Definition at line 165 of file identity.hpp.