a validator for stop-and-wait command Interests More...
#include <command-interest-validator.hpp>
Classes | |
class | Options |
Public Member Functions | |
CommandInterestValidator (unique_ptr< Validator > inner, const Options &options=Options()) | |
constructor More... | |
Public Member Functions inherited from ndn::security::Validator | |
Validator (Face *face=nullptr) | |
Validator constructor. More... | |
Validator (Face &face) | |
virtual | ~Validator () |
void | validate (const Data &data, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed) |
Validate Data and call either onValidated or onValidationFailed. More... | |
void | validate (const Interest &interest, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed) |
Validate Interest and call either onValidated or onValidationFailed. More... | |
Protected Member Functions | |
virtual void | checkPolicy (const Interest &interest, int nSteps, const OnInterestValidated &accept, const OnInterestValidationFailed &reject, std::vector< shared_ptr< ValidationRequest >> &nextSteps) override |
validate command Interest More... | |
virtual void | checkPolicy (const Data &data, int nSteps, const OnDataValidated &accept, const OnDataValidationFailed &reject, std::vector< shared_ptr< ValidationRequest >> &nextSteps) override |
validate Data More... | |
Protected Member Functions inherited from ndn::security::Validator | |
void | onData (const Interest &interest, const Data &data, const shared_ptr< ValidationRequest > &nextStep) |
Process the received certificate. More... | |
void | validate (const Data &data, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, int nSteps) |
void | validate (const Interest &interest, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed, int nSteps) |
virtual shared_ptr< const Data > | preCertificateValidation (const Data &data) |
Hooks. More... | |
virtual void | onNack (const Interest &interest, const lp::Nack &nack, int nRemainingRetries, const OnFailure &onFailure, const shared_ptr< ValidationRequest > &validationRequest) |
trigger when interest retrieves a Nack. More... | |
virtual void | onTimeout (const Interest &interest, int nRemainingRetries, const OnFailure &onFailure, const shared_ptr< ValidationRequest > &validationRequest) |
trigger when interest for certificate times out. More... | |
virtual void | afterCheckPolicy (const std::vector< shared_ptr< ValidationRequest >> &nextSteps, const OnFailure &onFailure) |
trigger after checkPolicy is done. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ndn::security::Validator | |
static bool | verifySignature (const Data &data, const v1::PublicKey &publicKey) |
Verify the data using the publicKey. More... | |
static bool | verifySignature (const Interest &interest, const v1::PublicKey &publicKey) |
Verify the signed Interest using the publicKey. More... | |
static bool | verifySignature (const Buffer &blob, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the blob using the publicKey against the signature. More... | |
static bool | verifySignature (const Data &data, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the data using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const Interest &interest, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the interest using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const uint8_t *buf, const size_t size, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the blob using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const Data &data, const DigestSha256 &sig) |
Verify the data against the SHA256 signature. More... | |
static bool | verifySignature (const Interest &interest, const DigestSha256 &sig) |
Verify the interest against the SHA256 signature. More... | |
static bool | verifySignature (const Buffer &blob, const DigestSha256 &sig) |
Verify the blob against the SHA256 signature. More... | |
static bool | verifySignature (const uint8_t *buf, const size_t size, const DigestSha256 &sig) |
Verify the blob against the SHA256 signature. More... | |
Protected Types inherited from ndn::security::Validator | |
typedef function< void(const std::string &)> | OnFailure |
Protected Attributes inherited from ndn::security::Validator | |
Face * | m_face |
a validator for stop-and-wait command Interests
This validator checks timestamp field of a stop-and-wait command Interest. Signed Interest validation and Data validation requests are delegated to an inner validator.
Definition at line 40 of file command-interest-validator.hpp.
error codes
Enumerator | |
---|---|
NONE | |
NAME_TOO_SHORT | |
BAD_TIMESTAMP | |
BAD_SIG_INFO | |
MISSING_KEY_LOCATOR | |
BAD_KEY_LOCATOR_TYPE | |
BAD_CERT_NAME | |
TIMESTAMP_OUT_OF_GRACE | |
TIMESTAMP_REORDER |
Definition at line 97 of file command-interest-validator.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 | inner is nullptr |
Definition at line 62 of file command-interest-validator.cpp.
References ndn::security::CommandInterestValidator::Options::gracePeriod.
|
overrideprotectedvirtual |
validate command Interest
This function executes the following validation procedure:
The validation request is rejected if any step in this procedure fails.
Implements ndn::security::Validator.
Definition at line 77 of file command-interest-validator.cpp.
References ndn::time::abs(), BAD_CERT_NAME, BAD_KEY_LOCATOR_TYPE, BAD_SIG_INFO, BAD_TIMESTAMP, ndn::security::v1::IdentityCertificate::certificateNameToPublicKeyName(), ndn::time::fromUnixTimestamp(), ndn::SignatureInfo::getKeyLocator(), ndn::KeyLocator::getName(), ndn::Interest::getName(), ndn::KeyLocator::getType(), ndn::security::CommandInterestValidator::Options::gracePeriod, ndn::SignatureInfo::hasKeyLocator(), ndn::security::invokeReject(), ndn::name::Component::isNumber(), ndn::KeyLocator::KeyLocator_Name, ndn::security::CommandInterestValidator::Options::maxTimestamps, ndn::signed_interest::MIN_LENGTH, MISSING_KEY_LOCATOR, NAME_TOO_SHORT, NONE, ndn::time::system_clock::now(), ndn::time::steady_clock::now(), ndn::signed_interest::POS_SIG_INFO, ndn::signed_interest::POS_TIMESTAMP, ndn::Name::size(), TIMESTAMP_OUT_OF_GRACE, TIMESTAMP_REORDER, ndn::security::CommandInterestValidator::Options::timestampTtl, ndn::name::Component::toNumber(), and ndn::SignatureInfo::wireDecode().
|
overrideprotectedvirtual |
validate Data
The validation request is redirected to the inner validator.
Implements ndn::security::Validator.
Definition at line 196 of file command-interest-validator.cpp.