22 #ifndef NDN_CXX_SECURITY_VALIDATOR_HPP
23 #define NDN_CXX_SECURITY_VALIDATOR_HPP
70 Validator(unique_ptr<ValidationPolicy> policy, unique_ptr<CertificateFetcher> certFetcher);
83 return *m_certFetcher;
148 loadAnchor(
const std::string& groupId,
const std::string& certfilePath,
188 continueValidation(
const shared_ptr<CertificateRequest>& certRequest,
189 const shared_ptr<ValidationState>& state);
198 requestCertificate(
const shared_ptr<CertificateRequest>& certRequest,
199 const shared_ptr<ValidationState>& state);
202 unique_ptr<ValidationPolicy> m_policy;
203 unique_ptr<CertificateFetcher> m_certFetcher;
204 size_t m_maxDepth{25};
Represents a Data packet.
Represents an Interest packet.
Interface used by the validator to fetch missing certificates.
Storage for trusted anchors, verified certificate cache, and unverified certificate cache.
Represents an NDN certificate.
Abstraction that implements a validation policy for Interest and Data packets.
Interface for validating data and interest packets.
void setMaxDepth(size_t depth) noexcept
Set the maximum depth of the certificate chain.
void cacheVerifiedCertificate(Certificate &&cert)
Cache verified cert a period of time (1 hour).
void resetAnchors()
Remove any previously loaded static or dynamic trust anchor.
Validator(unique_ptr< ValidationPolicy > policy, unique_ptr< CertificateFetcher > certFetcher)
Validator constructor.
ValidationPolicy & getPolicy() const noexcept
void resetVerifiedCertificates()
Remove any cached verified certificates.
void validate(const Data &data, const DataValidationSuccessCallback &successCb, const DataValidationFailureCallback &failureCb)
Asynchronously validate data.
size_t getMaxDepth() const noexcept
Return the maximum depth of the certificate chain.
CertificateFetcher & getFetcher() const noexcept
void loadAnchor(const std::string &groupId, Certificate &&cert)
Load static trust anchor.
std::function< void(const Data &)> DataValidationSuccessCallback
Callback to report a successful Data validation.
std::function< void(const Data &, const ValidationError &)> DataValidationFailureCallback
Callback to report a failed Data validation.
std::function< void(const Interest &)> InterestValidationSuccessCallback
Callback to report a successful Interest validation.
std::function< void(const Interest &, const ValidationError &)> InterestValidationFailureCallback
Callback to report a failed Interest validation.
boost::chrono::nanoseconds nanoseconds