represents an identity More...
#include <identity.hpp>
Public Member Functions | |
Identity () | |
Default Constructor. More... | |
const Name & | getName () const |
Get the name of the identity. More... | |
Key | getKey (const name::Component &keyId) const |
Get a key with id keyId . More... | |
const KeyContainer & | getKeys () const |
Get all the keys for this Identity. More... | |
Key & | getDefaultKey () const |
Get the default key for this Identity. More... | |
operator bool () const | |
Check if the Identity instance is valid. More... | |
bool | operator! () const |
Check if the Identity instance is invalid. More... | |
Static Public Attributes | |
static const name::Component | EMPTY_KEY_ID |
The default value of keyId when add a new key. More... | |
Friends | |
class | Pib |
class | IdentityContainer |
class | KeyChain |
represents an identity
Identity is at the top level in PIB's Identity-Key-Certificate hierarchy. An identity has a Name, and contains one or more keys, one of which is set as the default key of this identity. Properties of a key can be accessed after obtaining a Key object.
PibImpl::Error | when underlying implementation has non-semantic error. |
Definition at line 44 of file identity.hpp.
ndn::security::Identity::Identity | ( | ) |
Default Constructor.
Identity created using this default constructor is just a place holder. It must obtain an actual instance from Pib::getIdentity(...). A typical usage would be for exception handling:
Identity id; try { id = pib.getIdentity(...); } catch (Pib::Error&) { ... }
An Identity instance created using the constructor is invalid. Calling a member method on an invalid Identity instance may cause an std::domain_error.
Definition at line 31 of file identity.cpp.
Key & ndn::security::Identity::getDefaultKey | ( | ) | const |
Get the default key for this Identity.
Pib::Error | if the default key does not exist. |
Definition at line 133 of file identity.cpp.
Key ndn::security::Identity::getKey | ( | const name::Component & | keyId | ) | const |
Get a key with id keyId
.
keyId | The id of the key to get. |
Pib::Error | if the key does not exist. |
Definition at line 93 of file identity.cpp.
const KeyContainer & ndn::security::Identity::getKeys | ( | ) | const |
Get all the keys for this Identity.
Definition at line 101 of file identity.cpp.
const Name & ndn::security::Identity::getName | ( | ) | const |
Get the name of the identity.
Definition at line 53 of file identity.cpp.
ndn::security::Identity::operator bool | ( | ) | const |
Check if the Identity instance is valid.
Definition at line 145 of file identity.cpp.
bool ndn::security::Identity::operator! | ( | ) | const |
Check if the Identity instance is invalid.
Definition at line 151 of file identity.cpp.
|
friend |
Definition at line 48 of file identity.hpp.
|
friend |
Definition at line 49 of file identity.hpp.
|
friend |
Definition at line 47 of file identity.hpp.
|
static |
The default value of keyId when add a new key.
An empty keyId implies that the key digest should be used as the actual keyId.
Definition at line 177 of file identity.hpp.