22 #ifndef NDN_CXX_SECURITY_VALIDATOR_HPP
23 #define NDN_CXX_SECURITY_VALIDATOR_HPP
69 Validator(unique_ptr<ValidationPolicy> policy, unique_ptr<CertificateFetcher> certFetcher);
82 return *m_certFetcher;
147 loadAnchor(
const std::string& groupId,
const std::string& certfilePath,
187 continueValidation(
const shared_ptr<CertificateRequest>& certRequest,
188 const shared_ptr<ValidationState>& state);
197 requestCertificate(
const shared_ptr<CertificateRequest>& certRequest,
198 const shared_ptr<ValidationState>& state);
201 unique_ptr<ValidationPolicy> m_policy;
202 unique_ptr<CertificateFetcher> m_certFetcher;
203 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).
ValidationPolicy & getPolicy() const noexcept
void loadAnchor(const std::string &groupId, Certificate &&cert)
Load static trust anchor.
CertificateFetcher & getFetcher() const noexcept
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.
void resetVerifiedCertificates()
Remove any cached verified certificates.
void resetAnchors()
Remove any previously loaded static or dynamic trust anchor.
Validator(unique_ptr< ValidationPolicy > policy, unique_ptr< CertificateFetcher > certFetcher)
Validator constructor.
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.
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.
::boost::chrono::nanoseconds nanoseconds