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

CommandInterestSigner is a helper class to create command interests. More...

#include <command-interest-signer.hpp>

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

Public Member Functions

 CommandInterestSigner (KeyChain &keyChain)
 Create a CommandInterestSigner to use the keyChain to sign. More...
 
ptr_lib::shared_ptr< InterestmakeCommandInterest (const Name &name, const SigningInfo &params=KeyChain::getDefaultSigningInfo(), WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 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. 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...
 

Static Public Attributes

static const int POS_SIGNATURE_VALUE = -1
 
static const int POS_SIGNATURE_INFO = -2
 
static const int POS_NONCE = -3
 
static const int POS_TIMESTAMP = -4
 
static const int MINIMUM_SIZE = 4
 

Detailed Description

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

Constructor & Destructor Documentation

ndn::CommandInterestSigner::CommandInterestSigner ( KeyChain keyChain)

Create a CommandInterestSigner to use the keyChain to sign.

Parameters
keyChainThe KeyChain used to sign.

Member Function Documentation

ptr_lib::shared_ptr< Interest > ndn::CommandInterestSigner::makeCommandInterest ( const Name name,
const SigningInfo params = KeyChain::getDefaultSigningInfo(),
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)

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
nameThe Name for the Interest, which is copied.
params(optional) The signing parameters. If omitted, use a default SigningInfo().
wireFormat(optional) A WireFormat object used to encode the SignatureInfo and to encode interest name for signing. If omitted, use WireFormat getDefaultWireFormat().
Returns
A new command Interest object.

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