ValidationPolicyConfig implements a validator which can be set up via a configuration file. More...
#include <validation-policy-config.hpp>
Public Member Functions | |
| ValidationPolicyConfig () | |
| Create a default ValidationPolicyConfig. | |
| void | load (const std::string &filePath) |
| Load the configuration from the given config file. More... | |
| void | load (const std::string &input, const std::string &inputName) |
| Load the configuration from the given input string. More... | |
| void | load (const BoostInfoTree &configSection, const std::string &inputName) |
| Load the configuration from the given configSection. More... | |
| virtual void | checkPolicy (const Data &data, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) |
| Check the Data packet against the policy. More... | |
| virtual void | checkPolicy (const Interest &interest, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) |
| Check the Interest against the policy. More... | |
Public Member Functions inherited from ndn::ValidationPolicy | |
| void | setInnerPolicy (const ptr_lib::shared_ptr< ValidationPolicy > &innerPolicy) |
| Set the inner policy. More... | |
| bool | hasInnerPolicy () const |
| Check if the inner policy is set. More... | |
| ValidationPolicy & | getInnerPolicy () |
| Get the inner policy. More... | |
| void | setValidator (Validator &validator) |
| Set the validator to which this policy is associated. More... | |
| virtual void | checkCertificatePolicy (const CertificateV2 &certificate, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) |
| Check the certificate against the policy. More... | |
Additional Inherited Members | |
Public Types inherited from ndn::ValidationPolicy | |
|
typedef func_lib::function < void(const ptr_lib::shared_ptr < CertificateRequest > &certificateRequest, const ptr_lib::shared_ptr < ValidationState > &state)> | ValidationContinuation |
Static Public Member Functions inherited from ndn::ValidationPolicy | |
| static Name | getKeyLocatorName (const Data &data, ValidationState &state) |
| Extract the KeyLocator Name from a Data packet. More... | |
| static Name | getKeyLocatorName (const Interest &interest, ValidationState &state) |
| Extract the KeyLocator Name from a signed Interest. More... | |
Protected Attributes inherited from ndn::ValidationPolicy | |
| friend | TestValidator_ConstructorSetValidator_Test |
| Validator * | validator_ |
|
ptr_lib::shared_ptr < ValidationPolicy > | innerPolicy_ |
ValidationPolicyConfig implements a validator which can be set up via a configuration file.
For command Interest validation, this policy must be combined with ValidationPolicyCommandInterest in order to guard against replay attacks.
|
virtual |
Check the Data packet against the policy.
Your derived class must implement this. Depending on the implementation of the policy, this check can be done synchronously or asynchronously. The semantics of checkPolicy are as follows: If the packet violates the policy, then the policy should call state.fail() with an appropriate error code and error description. If the packet conforms to the policy and no further key retrievals are necessary, then the policy should call continueValidation(null, state). If the packet conforms to the policy and a key needs to be fetched, then the policy should call continueValidation(<appropriate-key-request-instance>, state).
| data | The Data packet to check. |
| state | The ValidationState of this validation. |
| continueValidation | The policy should call continueValidation() as described above. |
Implements ndn::ValidationPolicy.
|
virtual |
Check the Interest against the policy.
Your derived class must implement this. Depending on implementation of the policy, this check can be done synchronously or asynchronously. See the checkPolicy(Data) documentation for the semantics.
| interest | The Interest packet to check. |
| state | The ValidationState of this validation. |
| continueValidation | The policy should call continueValidation() as described above. |
Implements ndn::ValidationPolicy.
| void ndn::ValidationPolicyConfig::load | ( | const std::string & | filePath | ) |
Load the configuration from the given config file.
This replaces any existing configuration.
| filePath | The The path of the config file. |
| void ndn::ValidationPolicyConfig::load | ( | const std::string & | input, |
| const std::string & | inputName | ||
| ) |
Load the configuration from the given input string.
This replaces any existing configuration.
| input | The contents of the configuration rules, with lines separated by "\n" or "\r\n". |
| inputName | Used for log messages, etc. |
| void ndn::ValidationPolicyConfig::load | ( | const BoostInfoTree & | configSection, |
| const std::string & | inputName | ||
| ) |
Load the configuration from the given configSection.
This replaces any existing configuration.
| configSection | The configuration section loaded from the config file. It should have one <validator> section. |
| inputName | Used for log messages, etc. |
1.8.6