ndn::security::InterestSigner Class Reference

Helper class to create signed Interests. More...

#include <ndn-cxx/security/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)
 
Interest makeCommandInterest (Name name, const SigningInfo &params=SigningInfo())
 Creates and signs a command Interest. More...
 
void makeSignedInterest (Interest &interest, SigningInfo params=SigningInfo(), uint32_t signingFlags=WantNonce|WantTime)
 Signs an Interest (following Packet Specification v0.3 or newer) 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

◆ 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.

◆ 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.