PibIdentityImpl provides the backend implementation for PibIdentity.
More...
#include <pib-identity-impl.hpp>
PibIdentityImpl provides the backend implementation for PibIdentity.
A PibIdentity has only one backend instance, but may have multiple frontend handles. Each frontend handle is associated with the only one backend PibIdentityImpl.
| ndn::PibIdentityImpl::PibIdentityImpl |
( |
const Name & |
identityName, |
|
|
const ptr_lib::shared_ptr< PibImpl > & |
pibImpl, |
|
|
bool |
needInit |
|
) |
| |
Create a PibIdentityImpl with identityName.
- Parameters
-
| identityName | The name of the identity, which is copied. |
| pibImpl | The Pib backend implementation. |
| needInit | If true and the identity does not exist in the pibImpl back end, then create it (and If no default identity has been set, identityName becomes the default). If false, then throw Pib::Error if the identity does not exist in the pibImpl back end. |
- Exceptions
-
| Pib::Error | if the identity does not exist in the pibImpl back end and needInit is false. |
| ptr_lib::shared_ptr< PibKey > ndn::PibIdentityImpl::addKey |
( |
const uint8_t * |
key, |
|
|
size_t |
keyLength, |
|
|
const Name & |
keyName |
|
) |
| |
Add the key.
If a key with the same name already exists, overwrite the key. If no default key for the identity has been set, then set the added key as default for the identity.
- Parameters
-
| key | The public key bits. This copies the array. |
| keyLength | The length of the public key bits array. |
| keyName | The name of the key. This copies the name. |
- Returns
- The PibKey object.
| ptr_lib::shared_ptr< PibKey > & ndn::PibIdentityImpl::getDefaultKey |
( |
| ) |
|
Get the default key of this Identity.
- Returns
- The default PibKey.
- Exceptions
-
| ptr_lib::shared_ptr< PibKey > ndn::PibIdentityImpl::getKey |
( |
const Name & |
keyName | ) |
|
Get the key with name keyName.
- Parameters
-
| keyName | The name of the key. |
- Returns
- The PibKey object.
- Exceptions
-
| std::invalid_argument | if keyName does not match the identity name. |
| Pib::Error | if the key does not exist. |
| void ndn::PibIdentityImpl::removeKey |
( |
const Name & |
keyName | ) |
|
Remove the key with keyName and its related certificates.
If the key does not exist, do nothing.
- Parameters
-
| keyName | The name of the key. |
| ptr_lib::shared_ptr< PibKey > & ndn::PibIdentityImpl::setDefaultKey |
( |
const Name & |
keyName | ) |
|
Set the key with name keyName as the default key of the identity.
- Parameters
-
| keyName | The name of the key. This copies the name. |
- Returns
- The PibKey object of the default key.
- Exceptions
-
| std::invalid_argument | if the name of the key does not match the identity name. |
| Pib::Error | if the key does not exist. |
| ptr_lib::shared_ptr< PibKey > & ndn::PibIdentityImpl::setDefaultKey |
( |
const uint8_t * |
key, |
|
|
size_t |
keyLength, |
|
|
const Name & |
keyName |
|
) |
| |
Add a key with name keyName and set it as the default key of the identity.
- Parameters
-
| key | The array of encoded key bytes. |
| keyLength | The number of bytes in the key array. |
| keyName | The name of the key, which is copied. |
- Returns
- The PibKey object of the default key.
- Exceptions
-
| std::invalid_argument | if the name of the key does not match the identity name. |
| Pib::Error | if a key with the same name already exists. |
The documentation for this class was generated from the following files: