The PibKey class provides access to a key at the second level in the PIB's Identity-Key-Certificate hierarchy.
More...
#include <pib-key.hpp>
|
|
class | PibKeyContainer |
| |
|
class | KeyChain |
| |
The PibKey class provides access to a key at the second level in the PIB's Identity-Key-Certificate hierarchy.
A PibKey object has a Name (identity + "KEY" + keyId), and contains one or more CertificateV2 objects, one of which is set as the default certificate of this key. A certificate can be directly accessed by getting a CertificateV2 object.
Construct a key name based on the appropriate naming conventions.
- Parameters
-
| identityName | The name of the identity. |
| keyId | The key ID name component. |
- Returns
- The constructed name as a new Name.
| Name ndn::PibKey::extractIdentityFromKeyName |
( |
const Name & |
keyName | ) |
|
|
static |
Extract the identity namespace from keyName.
- Parameters
-
| keyName | The name of the key. |
- Returns
- The identity name as a new Name.
| ptr_lib::shared_ptr< CertificateV2 > ndn::PibKey::getCertificate |
( |
const Name & |
certificateName | ) |
|
Get the certificate with name certificateName.
- Parameters
-
| certificateName | The name of the certificate. |
- Returns
- A copy of the CertificateV2 object.
- Exceptions
-
| std::domain_error | if the backend implementation instance is invalid. |
| std::invalid_argument | if certificateName does not match the key name. |
| Pib::Error | if the certificate does not exist. |
| ptr_lib::shared_ptr< CertificateV2 > & ndn::PibKey::getDefaultCertificate |
( |
| ) |
|
Get the default certificate for this Key.
- Returns
- A copy of the default certificate.
- Exceptions
-
| std::domain_error | if the backend implementation instance is invalid. |
| Pib::Error | if the default certificate does not exist. |
| const Name & ndn::PibKey::getIdentityName |
( |
| ) |
|
Get the name of the identity this key belongs to.
- Returns
- The name of the identity.
- Exceptions
-
| std::domain_error | if the backend implementation instance is invalid. |
| KeyType ndn::PibKey::getKeyType |
( |
| ) |
|
Get the key type.
- Returns
- The key type.
- Exceptions
-
| std::domain_error | if the backend implementation instance is invalid. |
| const Blob & ndn::PibKey::getPublicKey |
( |
| ) |
|
Get the public key encoding.
- Returns
- The public key encoding.
- Exceptions
-
| std::domain_error | if the backend implementation instance is invalid. |
| bool ndn::PibKey::isValidKeyName |
( |
const Name & |
keyName | ) |
|
|
static |
Check if keyName follows the naming conventions for a key name.
- Parameters
-
| keyName | The name of the key. |
- Returns
- True if keyName follows the naming conventions, otherwise false.
The documentation for this class was generated from the following files:
- include/ndn-cpp/security/pib/pib-key.hpp
- src/security/pib/pib-key.cpp