NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::InterestSigner Class Reference

Helper class to create signed Interests. More...

#include <interest-signer.hpp>

Public Types

enum  SigningFlags : uint32_t { WantNonce = 1 << 0, WantTime = 1 << 1, WantSeqNum = 1 << 2 }
 Flags to indicate which elements to include in Interest signatures created with makeSignedInterest. More...
 

Public Member Functions

 InterestSigner (KeyChain &keyChain)
 
void makeSignedInterest (Interest &interest, SigningInfo params=SigningInfo(), uint32_t signingFlags=WantNonce|WantTime)
 Signs an Interest (following Packet Specification v0.3 or newer) More...
 
Interest makeCommandInterest (Name name, const SigningInfo &params=SigningInfo())
 Creates and signs a command Interest. More...
 

Detailed Description

Helper class to create signed Interests.

The signer generates signature elements for an Interest and signs it with the KeyChain.

Definition at line 35 of file interest-signer.hpp.

Member Enumeration Documentation

◆ SigningFlags

Flags to indicate which elements to include in Interest signatures created with makeSignedInterest.

See also
https://named-data.net/doc/NDN-packet-spec/0.3/signature.html#interest-signature
Enumerator
WantNonce 
WantTime 
WantSeqNum 

Definition at line 43 of file interest-signer.hpp.

Constructor & Destructor Documentation

◆ InterestSigner()

ndn::security::InterestSigner::InterestSigner ( KeyChain &  keyChain)
explicit

Definition at line 28 of file interest-signer.cpp.

Member Function Documentation

◆ makeSignedInterest()

void ndn::security::InterestSigner::makeSignedInterest ( Interest interest,
SigningInfo  params = SigningInfo(),
uint32_t  signingFlags = WantNonce | WantTime 
)

Signs an Interest (following Packet Specification v0.3 or newer)

Parameters
interestInterest to sign
paramsSigningInfo that provides parameters on how to sign the Interest.
signingFlagsIndicates which elements to include in the signature. At least one element must be specified for inclusion.
Exceptions
std::invalid_argumentNo signature elements were specified for inclusion.

Definition at line 35 of file interest-signer.cpp.

References ndn::random::generateSecureBytes(), ndn::security::SigningInfo::getSignatureInfo(), info, NDN_THROW, ndn::SignatureInfo::setNonce(), ndn::SignatureInfo::setSeqNum(), ndn::security::SigningInfo::setSignatureInfo(), ndn::security::SigningInfo::setSignedInterestFormat(), ndn::SignatureInfo::setTime(), ndn::security::V03, WantNonce, WantSeqNum, and WantTime.

◆ makeCommandInterest()

Interest ndn::security::InterestSigner::makeCommandInterest ( Name  name,
const SigningInfo params = SigningInfo() 
)

Creates and signs a command Interest.

Deprecated:
Use the new signed Interest format instead of command Interests.

These can be created with makeSignedInterest.

This generates a nonce and timestamp for the command Interest.

Definition at line 63 of file interest-signer.cpp.

References ndn::Name::append(), ndn::name::Component::fromNumber(), ndn::random::generateWord64(), ndn::time::system_clock::now(), ndn::Interest::setName(), and ndn::time::toUnixTimestamp().

Referenced by ndn::nfd::Controller::~Controller().


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