Validation policy for stop-and-wait command Interests. More...
#include <validation-policy-command-interest.hpp>
Classes | |
class | Options |
Public Member Functions | |
ValidationPolicyCommandInterest (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... | |
ValidationPolicy & | getInnerPolicy () |
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< ValidationPolicy > | m_innerPolicy |
Validation policy for stop-and-wait command Interests.
This policy checks the timestamp field of a stop-and-wait command Interest. Signed Interest validation and Data validation requests are delegated to an inner policy.
Definition at line 42 of file validation-policy-command-interest.hpp.
|
explicit |
constructor
inner | a Validator for signed Interest signature validation and Data validation; this must not be nullptr |
options | stop-and-wait command Interest validation options |
std::invalid_argument | inner policy is nullptr |
Definition at line 28 of file validation-policy-command-interest.cpp.
References ndn::security::v2::ValidationPolicyCommandInterest::Options::gracePeriod, nonstd::optional_lite::std11::move(), NDN_THROW, and ndn::security::v2::ValidationPolicy::setInnerPolicy().
|
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
state->fail
with appropriate error code and error description.Implements ndn::security::v2::ValidationPolicy.
Definition at line 43 of file validation-policy-command-interest.cpp.
References ndn::security::v2::ValidationPolicy::checkPolicy(), and ndn::security::v2::ValidationPolicy::getInnerPolicy().
|
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
state->fail
with appropriate error code and error description.Implements ndn::security::v2::ValidationPolicy.
Definition at line 50 of file validation-policy-command-interest.cpp.
References ndn::Name::at(), ndn::security::v2::ValidationPolicy::checkPolicy(), ndn::time::fromUnixTimestamp(), ndn::security::v2::ValidationPolicy::getInnerPolicy(), ndn::security::v2::getKeyLocatorName(), ndn::Interest::getName(), ndn::Interest::getSignatureInfo(), ndn::security::v2::ValidationPolicyCommandInterest::Options::gracePeriod, ndn::security::v2::ValidationPolicyCommandInterest::Options::maxRecords, ndn::command_interest::MIN_SIZE, ns3::ndn::Name, ndn::time::system_clock::now(), ndn::time::steady_clock::now(), ndn::security::v2::ValidationError::POLICY_ERROR, ndn::command_interest::POS_TIMESTAMP, ndn::security::v2::ValidationPolicyCommandInterest::Options::recordLifetime, ndn::Name::size(), ndn::Name::toUri(), and ndn::security::V03.