represents a key More...
#include <key.hpp>
Public Member Functions | |
Key () | |
Default Constructor. More... | |
const Name & | getName () const |
Get the name of the key. More... | |
const Name & | getIdentity () const |
Get the name of the belonging identity. More... | |
const name::Component & | getKeyId () const |
Get the key id of the key. More... | |
const v1::PublicKey & | getPublicKey () const |
Get public key. More... | |
v1::IdentityCertificate | getCertificate (const Name &certName) const |
Get a certificate. More... | |
const CertificateContainer & | getCertificates () const |
Get all the certificates for this key. More... | |
const v1::IdentityCertificate & | getDefaultCertificate () const |
Get the default certificate for this Key. More... | |
operator bool () const | |
Check if the Key instance is valid. More... | |
bool | operator! () const |
Check if the Key instance is invalid. More... | |
Friends | |
class | Identity |
class | KeyContainer |
class | KeyChain |
represents a key
Key is at the second level in PIB's Identity-Key-Certificate hierarchy. An Key has a Name (identity + keyId), and contains one or more certificates, one of which is set as the default certificate of this key. A certificate can be directly accessed from a Key object.
PibImpl::Error | when underlying implementation has non-semantic error. |
ndn::security::Key::Key | ( | ) |
Default Constructor.
Key created using this default constructor is just a place holder. It must obtain an actual instance from Identity::getKey(...). A typical usage would be for exception handling:
Key key; try { key = Identity.getKey(...); } catch (Pib::Error&) { ... }
A Key instance created using the constructor is invalid. Calling a member method on an invalid Key instance may cause an std::domain_error.
v1::IdentityCertificate ndn::security::Key::getCertificate | ( | const Name & | certName | ) | const |
const CertificateContainer & ndn::security::Key::getCertificates | ( | ) | const |
const v1::IdentityCertificate & ndn::security::Key::getDefaultCertificate | ( | ) | const |
Get the default certificate for this Key.
Pib::Error | if the default certificate does not exist. |
const Name & ndn::security::Key::getIdentity | ( | ) | const |
const name::Component & ndn::security::Key::getKeyId | ( | ) | const |
const Name & ndn::security::Key::getName | ( | ) | const |
const v1::PublicKey & ndn::security::Key::getPublicKey | ( | ) | const |
ndn::security::Key::operator bool | ( | ) | const |
bool ndn::security::Key::operator! | ( | ) | const |
|
friend |