All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
ndn::CommandInterestGenerator Class Reference

An CommandInterestGenerator keeps track of a timestamp and generates command interests according to the NFD Signed Command Interests protocol: https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest. More...

#include <command-interest-generator.hpp>

Inheritance diagram for ndn::CommandInterestGenerator:
ndn::CommandInterestPreparer

Public Member Functions

 CommandInterestGenerator ()
 Create a new CommandInterestGenerator and initialize the timestamp to now.
 
void generate (Interest &interest, KeyChain &keyChain, const Name &certificateName, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Append a timestamp component and a random value component to interest's name. More...
 
- Public Member Functions inherited from ndn::CommandInterestPreparer
 CommandInterestPreparer ()
 Create a CommandInterestPreparer and initialize the timestamp to now.
 
void prepareCommandInterestName (Interest &interest, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Append a timestamp component and a random nonce component to interest's name. More...
 
void setNowOffsetMilliseconds_ (Milliseconds nowOffsetMilliseconds)
 Set the offset for when prepareCommandInterestName() gets the current time, which should only be used for testing. More...
 

Detailed Description

An CommandInterestGenerator keeps track of a timestamp and generates command interests according to the NFD Signed Command Interests protocol: https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest.

Member Function Documentation

void ndn::CommandInterestGenerator::generate ( Interest interest,
KeyChain keyChain,
const Name certificateName,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)

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
interestThe interest whose name is append with components.
keyChainThe KeyChain for calling sign.
certificateNameThe certificate name of the key to use for signing.
wireFormatA WireFormat object used to encode the SignatureInfo and to encode interest name for signing. If omitted, use WireFormat getDefaultWireFormat().

The documentation for this class was generated from the following files: