PibKeyImpl provides the backend implementation for PibKey.
More...
#include <pib-key-impl.hpp>
PibKeyImpl provides the backend implementation for PibKey.
A PibKey has only one backend instance, but may have multiple frontend handles. Each frontend handle is associated with the only one backend PibKeyImpl.
| ndn::PibKeyImpl::PibKeyImpl |
( |
const Name & |
keyName, |
|
|
const uint8_t * |
keyEncoding, |
|
|
size_t |
keyEncodingLength, |
|
|
const ptr_lib::shared_ptr< PibImpl > & |
pibImpl |
|
) |
| |
Create a PibKeyImpl with keyName.
If the key does not exist in the backend implementation, add it by creating it from the keyEncoding. If a key with keyName already exists, overwrite it.
- Parameters
-
| keyName | The name of the key, which is copied. |
| keyEncoding | The array of encoded key bytes, which is copied. |
| keyEncodingLength | The number of bytes in the key encoding array. |
| pibImpl | The Pib backend implementation. |
| ndn::PibKeyImpl::PibKeyImpl |
( |
const Name & |
keyName, |
|
|
const ptr_lib::shared_ptr< PibImpl > & |
pibImpl |
|
) |
| |
Create a PibKeyImpl with keyName.
Initialize the cached key encoding with pibImpl->getKeyBits().
- Parameters
-
| keyName | The name of the key, which is copied. |
| pibImpl | The Pib backend implementation. |
- Exceptions
-
| void ndn::PibKeyImpl::addCertificate |
( |
const CertificateV2 & |
certificate | ) |
|
Add the certificate.
If a certificate with the same name (without implicit digest) already exists, then overwrite the certificate. If no default certificate for the key has been set, then set the added certificate as default for the key.
- Parameters
-
| certificate | The certificate to add. This copies the object. |
- Exceptions
-
| std::invalid_argument | if the name of the certificate does not match the key name. |
| ptr_lib::shared_ptr< CertificateV2 > ndn::PibKeyImpl::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::invalid_argument | if certificateName does not match the key name. |
| Pib::Error | if the certificate does not exist. |
| ptr_lib::shared_ptr< CertificateV2 > & ndn::PibKeyImpl::getDefaultCertificate |
( |
| ) |
|
Get the default certificate for this Key.
- Returns
- A copy of the default certificate.
- Exceptions
-
| Pib::Error | if the default certificate does not exist. |
| const Name& ndn::PibKeyImpl::getIdentityName |
( |
| ) |
const |
|
inline |
Get the name of the identity this key belongs to.
- Returns
- The name of the identity.
| KeyType ndn::PibKeyImpl::getKeyType |
( |
| ) |
const |
|
inline |
Get the key type.
- Returns
- The key type.
| const Blob& ndn::PibKeyImpl::getPublicKey |
( |
| ) |
const |
|
inline |
Get the public key encoding.
- Returns
- The public key encoding.
| void ndn::PibKeyImpl::removeCertificate |
( |
const Name & |
certificateName | ) |
|
Remove the certificate with name certificateName.
If the certificate does not exist, do nothing.
- Parameters
-
| certificateName | The name of the certificate. |
- Exceptions
-
| std::invalid_argument | if certificateName does not match the key name. |
| ptr_lib::shared_ptr< CertificateV2 > & ndn::PibKeyImpl::setDefaultCertificate |
( |
const Name & |
certificateName | ) |
|
Set the existing certificate with name certificateName as the default certificate.
- Parameters
-
| certificateName | The name of the certificate. |
- Returns
- The default certificate.
- Exceptions
-
| std::invalid_argument | if certificateName does not match the key name |
| Pib::Error | if the certificate does not exist. |
Add the certificate and set it as the default certificate of the key.
If a certificate with the same name (without implicit digest) already exists, then overwrite the certificate.
- Parameters
-
| certificate | The certificate to add. This copies the object. |
- Exceptions
-
| std::invalid_argument | if the name of the certificate does not match the key name. |
- Returns
- The default certificate.
The documentation for this class was generated from the following files:
- src/security/pib/detail/pib-key-impl.hpp
- src/security/pib/detail/pib-key-impl.cpp