Class: CommandInterestSigner

CommandInterestSigner(keyChain)

new CommandInterestSigner(keyChain)

CommandInterestSigner is a helper class to create command interests. This keeps track of a timestamp and generates command interests by adding name components according to the NFD Signed Command Interests protocol. See makeCommandInterest() for details. https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest Create a CommandInterestSigner to use the keyChain to sign.
Parameters:
Name Type Description
keyChain KeyChain The KeyChain used to sign.
Source:

Methods

makeCommandInterest(name, params, wireFormat, onComplete, onError) → {Interest}

Append the timestamp and nonce name components to the supplied name, create an Interest object and signs it with the KeyChain given to the constructor. This ensures that the timestamp is greater than the timestamp used in the previous call.
Parameters:
Name Type Description
name Name The Name for the Interest, which is copied.
params SigningInfo (optional) The signing parameters. If omitted, use a default SigningInfo().
wireFormat WireFormat (optional) A WireFormat object used to encode the SignatureInfo and to encode interest name for signing. If omitted, use WireFormat getDefaultWireFormat().
onComplete function (optional) This calls onComplete(interest) with the new command Interest object. (Some crypto libraries only use a callback, so onComplete is required to use these.) NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.
onError function (optional) If defined, then onComplete must be defined and if there is an exception, then this calls onError(exception) with the exception. If onComplete is defined but onError is undefined, then this will log any thrown exception. (Some database libraries only use a callback, so onError is required to be notified of an exception.) NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.
Source:
Returns:
If onComplete is omitted, return the new command Interest object. Otherwise, if onComplete is supplied then return undefined and use onComplete as described above.
Type
Interest