Frontend handle for a key in the PIB. More...
#include <ndn-cxx/security/pib/key.hpp>
Public Member Functions | |
Key () noexcept | |
Default constructor. More... | |
Certificate | getCertificate (const Name &certName) const |
Return the certificate with the given name. More... | |
const CertificateContainer & | getCertificates () const |
Return all the certificates of this key. More... | |
const Certificate & | getDefaultCertificate () const |
Return the default certificate for this key. More... | |
const Name & | getIdentity () const |
Return the name of the owning identity. More... | |
KeyType | getKeyType () const |
Return the key type. More... | |
const Name & | getName () const |
Return the name of the key. More... | |
span< const uint8_t > | getPublicKey () const |
Return the raw public key bits. More... | |
operator bool () const noexcept | |
Returns true if the instance is valid. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Key &key) |
bool | operator== (const Key &lhs, const Key &rhs) noexcept |
Frontend handle for a key in the PIB.
Key is at the second level in PIB's Identity-Key-Certificate hierarchy. A key has the name /<Identity>/KEY/<KeyId>
, and contains one or more certificates, one of which is set as default certificate of that key. Certificates can be directly accessed from a Key object.
|
defaultnoexcept |
Default constructor.
A Key created using this default constructor is just a placeholder. You can obtain an actual instance from Identity::getKey(). A typical usage would be for exception handling:
An instance created using this constructor is invalid. Calling a member function on an invalid Key instance may throw an std::domain_error.
Certificate ndn::security::pib::Key::getCertificate | ( | const Name & | certName | ) | const |
Return the certificate with the given name.
std::invalid_argument | certName does not match the key name. |
Pib::Error | the certificate does not exist. |
const CertificateContainer & ndn::security::pib::Key::getCertificates | ( | ) | const |
const Certificate & ndn::security::pib::Key::getDefaultCertificate | ( | ) | const |
Return the default certificate for this key.
Pib::Error | the default certificate does not exist. |
const Name & ndn::security::pib::Key::getIdentity | ( | ) | const |
KeyType ndn::security::pib::Key::getKeyType | ( | ) | const |
const Name & ndn::security::pib::Key::getName | ( | ) | const |
span< const uint8_t > ndn::security::pib::Key::getPublicKey | ( | ) | const |
|
explicitnoexcept |
|
friend |