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

A CommandInterestPreparer keeps track of a timestamp and prepares a command interest by adding a timestamp and nonce to the name of an Interest. More...

#include <command-interest-preparer.hpp>

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

Public Member Functions

 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

A CommandInterestPreparer keeps track of a timestamp and prepares a command interest by adding a timestamp and nonce to the name of an Interest.

This class is primarily designed to be used by the CommandInterestSigner, but can also be using in an application that defines custom signing methods not supported by the KeyChain (such as HMAC-SHA1). See the Command Interest documentation: https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest

Member Function Documentation

void ndn::CommandInterestPreparer::prepareCommandInterestName ( Interest interest,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)

Append a timestamp component and a random nonce component to interest's name.

This ensures that the timestamp is greater than the timestamp used in the previous call.

Parameters
interestThe interest whose name is append with components.
wireFormat(optional) A WireFormat object used to encode the SignatureInfo. If omitted, use WireFormat getDefaultWireFormat().
void ndn::CommandInterestPreparer::setNowOffsetMilliseconds_ ( Milliseconds  nowOffsetMilliseconds)
inline

Set the offset for when prepareCommandInterestName() gets the current time, which should only be used for testing.

Parameters
nowOffsetMillisecondsThe offset in milliseconds.

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