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

Validation policy for signed Interests. More...

#include <validation-policy-signed-interest.hpp>

Inheritance diagram for ndn::security::v2::ValidationPolicySignedInterest:
Collaboration diagram for ndn::security::v2::ValidationPolicySignedInterest:

Classes

class  Options
 

Public Member Functions

 ValidationPolicySignedInterest (unique_ptr< ValidationPolicy > inner, const Options &options={})
 Constructor. More...
 
- Public Member Functions inherited from ndn::security::v2::ValidationPolicy
virtual ~ValidationPolicy ()=default
 
void setInnerPolicy (unique_ptr< ValidationPolicy > innerPolicy)
 Set inner policy. More...
 
bool hasInnerPolicy () const
 Check if inner policy is set. More...
 
ValidationPolicygetInnerPolicy ()
 Return the inner policy. More...
 
void setValidator (Validator &validator)
 Set validator to which the policy is associated. More...
 
virtual void checkPolicy (const Certificate &certificate, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
 Check certificate against the policy. More...
 

Protected Member Functions

void checkPolicy (const Data &data, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
 Check data against the policy. More...
 
void checkPolicy (const Interest &interest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
 Check interest against the policy. More...
 

Additional Inherited Members

- Public Types inherited from ndn::security::v2::ValidationPolicy
using ValidationContinuation = std::function< void(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state)>
 
- Public Attributes inherited from ndn::security::v2::ValidationPolicy
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED __pad0__: Validator* m_validator = nullptr
 
unique_ptr< ValidationPolicym_innerPolicy
 

Detailed Description

Validation policy for signed Interests.

This policy checks the timestamp, sequence number, and nonce fields of signed Interests.

Definition at line 41 of file validation-policy-signed-interest.hpp.

Constructor & Destructor Documentation

◆ ValidationPolicySignedInterest()

ndn::security::v2::ValidationPolicySignedInterest::ValidationPolicySignedInterest ( unique_ptr< ValidationPolicy inner,
const Options options = {} 
)
explicit

Constructor.

Parameters
innerValidator for signed Interest and Data validation. This must not be nullptr.
optionsSigned Interest validation options
Exceptions
std::invalid_argumentInner policy is nullptr

Definition at line 28 of file validation-policy-signed-interest.cpp.

References nonstd::optional_lite::std11::move(), NDN_THROW, ndn::security::v2::ValidationPolicy::setInnerPolicy(), and ndn::security::v2::ValidationPolicySignedInterest::Options::timestampGracePeriod.

Member Function Documentation

◆ checkPolicy() [1/2]

void ndn::security::v2::ValidationPolicySignedInterest::checkPolicy ( const Data data,
const shared_ptr< ValidationState > &  state,
const ValidationContinuation continueValidation 
)
overrideprotectedvirtual

Check data against the policy.

Depending on implementation of the policy, this check can be done synchronously or asynchronously.

Semantics of checkPolicy has changed from v1::Validator

  • If packet violates policy, the policy should call state->fail with appropriate error code and error description.
  • If packet conforms to the policy and no further certificate retrievals are necessary, the policy should call continueValidation(nullptr, state)
  • If packet conforms to the policy and a certificate needs to be fetched, the policy should call continueValidation(<appropriate-cert-request-instance>, state)

Implements ndn::security::v2::ValidationPolicy.

Definition at line 43 of file validation-policy-signed-interest.cpp.

References ndn::security::v2::ValidationPolicy::checkPolicy(), and ndn::security::v2::ValidationPolicy::getInnerPolicy().

◆ checkPolicy() [2/2]

void ndn::security::v2::ValidationPolicySignedInterest::checkPolicy ( const Interest interest,
const shared_ptr< ValidationState > &  state,
const ValidationContinuation continueValidation 
)
overrideprotectedvirtual

Check interest against the policy.

Depending on implementation of the policy, this check can be done synchronously or asynchronously.

Semantics of checkPolicy has changed from v1::Validator

  • If packet violates policy, the policy should call state->fail with appropriate error code and error description.
  • If packet conforms to the policy and no further certificate retrievals are necessary, the policy should call continueValidation(nullptr, state)
  • If packet conforms to the policy and a certificate needs to be fetched, the policy should call continueValidation(<appropriate-cert-request-instance>, state)

Implements ndn::security::v2::ValidationPolicy.

Definition at line 51 of file validation-policy-signed-interest.cpp.

References ndn::time::abs(), ndn::security::v2::ValidationPolicy::checkPolicy(), ndn::security::v2::ValidationPolicy::getInnerPolicy(), ndn::security::v2::getKeyLocatorName(), ndn::Interest::getSignatureInfo(), ndn::security::v2::ValidationPolicySignedInterest::Options::maxNonceRecordCount, ndn::security::v2::ValidationPolicySignedInterest::Options::maxRecordCount, ndn::time::system_clock::now(), ndn::time::steady_clock::now(), ndn::security::v2::ValidationError::POLICY_ERROR, ndn::security::v2::ValidationPolicySignedInterest::Options::shouldValidateNonces, ndn::security::v2::ValidationPolicySignedInterest::Options::shouldValidateSeqNums, ndn::security::v2::ValidationPolicySignedInterest::Options::shouldValidateTimestamps, ndn::security::v2::ValidationPolicySignedInterest::Options::timestampGracePeriod, and ndn::security::V03.


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