a validator for stop-and-wait command Interests More...
#include <command-interest-validator.hpp>
Data Structures | |
class | Options |
Public Member Functions | |
CommandInterestValidator (unique_ptr< Validator > inner, const Options &options=Options()) | |
constructor More... | |
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... | |
Static Public Member Functions | |
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 | |
typedef function< void(const std::string &)> | OnFailure |
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... | |
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) |
void | onData (const Interest &interest, const Data &data, const shared_ptr< ValidationRequest > &nextStep) |
Process the received certificate. More... | |
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... | |
Protected Attributes | |
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.
|
protectedinherited |
Definition at line 242 of file 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.
|
protectedvirtualinherited |
trigger after checkPolicy is done.
Validator can decide how to handle the set of validation requests according to the trust model.
nextSteps | A set of validation request made by checkPolicy. |
onFailure | Failure callback when errors happen in processing nextSteps. |
Definition at line 305 of file validator.cpp.
|
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.
|
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.
|
protectedinherited |
Process the received certificate.
Definition at line 89 of file validator.cpp.
|
protectedvirtualinherited |
trigger when interest retrieves a Nack.
Validator can decide how to handle a Nack, either call onFailure, or retry.
interest | The interest that retrieves a Nack. |
nack | The Nack that is retrieved. |
nRemainingRetries | The number of retries left. |
onFailure | Failure callback when there is no more retries remaining. |
validationRequest | The validationRequest containing the context of the interest. |
Definition at line 258 of file validator.cpp.
|
protectedvirtualinherited |
trigger when interest for certificate times out.
Validator can decide how to handle the timeout, either call onFailure, or retry.
interest | The interest that times out. |
nRemainingRetries | The number of retries left. |
onFailure | Failure callback when there is no more retries remaining. |
validationRequest | The validationRequest containing the context of the interest. |
Definition at line 282 of file validator.cpp.
|
inlineprotectedvirtualinherited |
Hooks.
trigger before validating requested certificate.
The Data:
This method returns a data (actually certificate) that is will be passed as Data into: Validator::validate(const Data& data, const OnDataValidated& onValidated, const OnDataValidationFailed& onValidationFailed, int nSteps);
Definition at line 278 of file validator.hpp.
|
inlineinherited |
Validate Data and call either onValidated or onValidationFailed.
data | The Data with the signature to check. |
onValidated | If the Data is validated, this calls onValidated(data). |
onValidationFailed | If validation fails, this calls onValidationFailed(data). |
Definition at line 81 of file validator.hpp.
|
inlineinherited |
Validate Interest and call either onValidated or onValidationFailed.
interest | The Interest with the signature to check. |
onValidated | If the Interest is validated, this calls onValidated(interest). |
onValidationFailed | If validation fails, this calls onValidationFailed(interest). |
Definition at line 96 of file validator.hpp.
|
protectedinherited |
Definition at line 69 of file validator.cpp.
|
protectedinherited |
Definition at line 49 of file validator.cpp.
|
staticinherited |
Verify the data using the publicKey.
Definition at line 105 of file validator.cpp.
|
staticinherited |
Verify the signed Interest using the publicKey.
(Note the signature covers the first n-2 name components).
Definition at line 117 of file validator.cpp.
|
inlinestaticinherited |
Verify the blob using the publicKey against the signature.
Definition at line 121 of file validator.hpp.
|
inlinestaticinherited |
Verify the data using the publicKey against the SHA256-RSA signature.
Definition at line 128 of file validator.hpp.
|
inlinestaticinherited |
Verify the interest using the publicKey against the SHA256-RSA signature.
(Note the signature covers the first n-2 name components).
Definition at line 142 of file validator.hpp.
|
staticinherited |
Verify the blob using the publicKey against the SHA256-RSA signature.
Definition at line 143 of file validator.cpp.
|
inlinestaticinherited |
Verify the data against the SHA256 signature.
Definition at line 166 of file validator.hpp.
|
inlinestaticinherited |
Verify the interest against the SHA256 signature.
(Note the signature covers the first n-2 name components).
Definition at line 179 of file validator.hpp.
|
inlinestaticinherited |
Verify the blob against the SHA256 signature.
Definition at line 193 of file validator.hpp.
|
staticinherited |
Verify the blob against the SHA256 signature.
Definition at line 235 of file validator.cpp.
|
protectedinherited |
Definition at line 331 of file validator.hpp.