new CommandInterestGenerator()
A CommandInterestGenerator keeps track of a timestamp and generates command
interests according to the NFD Signed Command Interests protocol:
http://redmine.named-data.net/projects/nfd/wiki/Command_Interests
Create a new CommandInterestGenerator and initialize the timestamp to now.
Methods
generate(interest, keyChain, certificateName, wireFormat, onComplete)
Append a timestamp component and a random value component to interest's name.
This ensures that the timestamp is greater than the timestamp used in the
previous call. Then use keyChain to sign the interest which appends a
SignatureInfo component and a component with the signature bits. If the
interest lifetime is not set, this sets it.
Parameters:
Name | Type | Description |
---|---|---|
interest |
Interest | The interest whose name is append with components. |
keyChain |
KeyChain | The KeyChain for calling sign. |
certificateName |
Name | The certificate name of the key to use for signing. |
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() when complete. (Some crypto/database libraries only use a callback, so onComplete is required to use these.) |