PibIdentity Class¶
PibIdentity is at the top level in PIB’s Identity-Key-Certificate hierarchy. An identity has a Name, and contains zero or more keys, at most one of which is set as the default key of this identity. Properties of a key can be accessed after obtaining a PibKey object.
[C++]: | #include <ndn-cpp/security/pib/pib-identity.hpp> Namespace:
ndn |
---|---|
[Python]: | Module: pyndn.security.pib |
[Java]: | Package: net.named_data.jndn.security.pib |
PibIdentity.getDefaultKey Method¶
Get the default key of this Identity.
[C++]: | ptr_lib::shared_ptr<PibKey> getDefaultKey();
|
---|---|
[Python]: | # Returns PibKey
def getDefaultKey(self)
|
[JavaScript]: | // Returns PibKey
PibIdentity.prototype.getDefaultKey = function(
[onComplete // function]
[, onError // function]
)
|
[Java]: | public final PibKey getDefaultKey()
|
Parameters: |
|
Returns: | The default PibKey object. [JavaScript only: However, if onComplete is supplied then return undefined and use onComplete as described above.] |
Throw: | Pib.Error if the default key has not been set. |
PibIdentity.getKey Method¶
Get the key with name keyName.
[C++]: | ptr_lib::shared_ptr<PibKey> getKey(
const Name& keyName
) const;
|
---|---|
[Python]: | # Returns PibKey
def getKey(self,
keyName # Name
)
|
[JavaScript]: | // Returns PibKey
PibIdentity.prototype.getKey = function(
keyName // Name
[, onComplete // function]
[, onError // function]
)
|
[Java]: | public final PibKey getKey(
Name keyName
)
|
Parameters: |
|
Returns: | The PibKey object. [JavaScript only: However, if onComplete is supplied then return undefined and use onComplete as described above.] |
Throw: | Pib.Error if the identity does not exist, or an illegal argument exception if keyName does not match the identity name. |
PibIdentity.getName Method¶
Get the name of the identity.
[C++]: | const Name& getName();
|
---|---|
[Python]: | # Returns Name
def getName(self)
|
[JavaScript]: | // Returns Name
PibIdentity.prototype.getName = function()
|
[Java]: | public final Name getName()
|
Returns: | The name of the identity. You must not change the Name object. If you need to change it then make a copy. |