All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
ndn::ValidatorConfig Class Reference

ValidatorConfig extends Validator to implements a validator which can be set up via a configuration file. More...

#include <validator-config.hpp>

Inheritance diagram for ndn::ValidatorConfig:
ndn::Validator ndn::CertificateStorage

Public Member Functions

 ValidatorConfig (const ptr_lib::shared_ptr< CertificateFetcher > &fetcher)
 Create a ValidatorConfig to use the given certificate fetcher. More...
 
 ValidatorConfig (Face &face)
 Create a ValidatorConfig that uses a CertificateFetcherFromNetwork for the given Face. More...
 
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...
 
- Public Member Functions inherited from ndn::Validator
 Validator (const ptr_lib::shared_ptr< ValidationPolicy > &policy, const ptr_lib::shared_ptr< CertificateFetcher > &certificateFetcher=ptr_lib::make_shared< CertificateFetcherOffline >())
 Create a Validator with the policy and fetcher. More...
 
ValidationPolicygetPolicy ()
 Get the ValidationPolicy given to the constructor. More...
 
CertificateFetchergetFetcher ()
 Get the CertificateFetcher given to (or created in) the constructor. More...
 
void setMaxDepth (size_t maxDepth)
 Set the maximum depth of the certificate chain. More...
 
size_t getMaxDepth () const
 Get the maximum depth of the certificate chain. More...
 
void validate (const Data &data, const DataValidationSuccessCallback &successCallback, const DataValidationFailureCallback &failureCallback)
 Asynchronously validate the Data packet. More...
 
void validate (const Interest &interest, const InterestValidationSuccessCallback &successCallback, const InterestValidationFailureCallback &failureCallback)
 Asynchronously validate the Interest. More...
 
- Public Member Functions inherited from ndn::CertificateStorage
ptr_lib::shared_ptr
< CertificateV2
findTrustedCertificate (const Interest &interestForCertificate)
 Find a trusted certificate in the trust anchor container or in the verified cache. More...
 
bool isCertificateKnown (const Name &certificatePrefix)
 Check if the certificate with the given name prefix exists in the verified cache, the unverified cache, or in the set of trust anchors. More...
 
void cacheUnverifiedCertificate (const CertificateV2 &certificate)
 Cache the unverified certificate for a period of time (5 minutes). More...
 
const TrustAnchorContainergetTrustAnchors () const
 Get the trust anchor container. More...
 
const CertificateCacheV2getVerifiedCertificateCache () const
 Get the verified certificate cache. More...
 
const CertificateCacheV2getUnverifiedCertificateCache () const
 Get the unverified certificate cache. More...
 
void loadAnchor (const std::string &groupId, const CertificateV2 &certificate)
 Load a static trust anchor. More...
 
void loadAnchor (const std::string &groupId, const std::string &path, Milliseconds refreshPeriod, bool isDirectory=false)
 Load dynamic trust anchors. More...
 
void resetAnchors ()
 Remove any previously loaded static or dynamic trust anchors.
 
void cacheVerifiedCertificate (const CertificateV2 &certificate)
 Cache the verified certificate a period of time (1 hour). More...
 
void resetVerifiedCertificates ()
 Remove any cached verified certificates.
 
void setCacheNowOffsetMilliseconds_ (Milliseconds nowOffsetMilliseconds)
 Set the offset when the cache insert() and refresh() get the current time, which should only be used for testing. More...
 

Additional Inherited Members

- Protected Attributes inherited from ndn::CertificateStorage
TrustAnchorContainer trustAnchors_
 
CertificateCacheV2 verifiedCertificateCache_
 
CertificateCacheV2 unverifiedCertificateCache_
 

Detailed Description

ValidatorConfig extends Validator to implements a validator which can be set up via a configuration file.

Constructor & Destructor Documentation

ndn::ValidatorConfig::ValidatorConfig ( const ptr_lib::shared_ptr< CertificateFetcher > &  fetcher)
inline

Create a ValidatorConfig to use the given certificate fetcher.

Parameters
fetcherThe certificate fetcher.
ndn::ValidatorConfig::ValidatorConfig ( Face face)
inline

Create a ValidatorConfig that uses a CertificateFetcherFromNetwork for the given Face.

Parameters
faceThe face for the certificate fetcher to call expressInterest.

Member Function Documentation

void ndn::ValidatorConfig::load ( const std::string &  filePath)
inline

Load the configuration from the given config file.

This replaces any existing configuration.

Parameters
filePathThe The path of the config file.
void ndn::ValidatorConfig::load ( const std::string &  input,
const std::string &  inputName 
)
inline

Load the configuration from the given input string.

This replaces any existing configuration.

Parameters
inputThe contents of the configuration rules, with lines separated by "\n" or "\r\n".
inputNameUsed for log messages, etc.
void ndn::ValidatorConfig::load ( const BoostInfoTree configSection,
const std::string &  inputName 
)
inline

Load the configuration from the given configSection.

This replaces any existing configuration.

Parameters
configSectionThe configuration section loaded from the config file. It should have one <validator> section.
inputNameUsed for log messages, etc.

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