CertificateFetcher is an abstract base class which provides an interface used by the validator to fetch missing certificates. More...
#include <certificate-fetcher.hpp>
Public Types | |
|
typedef func_lib::function < void(const ptr_lib::shared_ptr < CertificateV2 > &certificate, const ptr_lib::shared_ptr < ValidationState > &state)> | ValidationContinuation |
Public Member Functions | |
| virtual void | setCertificateStorage (CertificateStorage &certificateStorage) |
| Assign the certificate storage used to check for known certificates and to cache unverified ones. More... | |
| void | fetch (const ptr_lib::shared_ptr< CertificateRequest > &certificateRequest, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) |
| Asynchronously fetch a certificate. More... | |
Protected Member Functions | |
| virtual void | doFetch (const ptr_lib::shared_ptr< CertificateRequest > &certificateRequest, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)=0 |
| An implementation to fetch a certificate asynchronously. More... | |
Protected Attributes | |
| CertificateStorage * | certificateStorage_ |
CertificateFetcher is an abstract base class which provides an interface used by the validator to fetch missing certificates.
|
protectedpure virtual |
An implementation to fetch a certificate asynchronously.
The subclass must implement this method.
| certificateRequest | The the request with the Interest for fetching the certificate. |
| state | The validation state. |
| continueValidation | After fetching, this calls continueValidation(certificate, state) where certificate is the fetched certificate and state is the ValidationState. |
Implemented in ndn::CertificateFetcherFromNetwork, and ndn::CertificateFetcherOffline.
| void ndn::CertificateFetcher::fetch | ( | const ptr_lib::shared_ptr< CertificateRequest > & | certificateRequest, |
| const ptr_lib::shared_ptr< ValidationState > & | state, | ||
| const ValidationContinuation & | continueValidation | ||
| ) |
Asynchronously fetch a certificate.
setCertificateStorage must have been called first. If the requested certificate exists in the storage, then this method will immediately call continueValidation with the certificate. If certificate is not available, then the implementation-specific doFetch will be called to asynchronously fetch the certificate. The successfully-retrieved certificate will be automatically added to the unverified cache of the certificate storage. When the requested certificate is retrieved, continueValidation is called. Otherwise, the fetcher implementation calls state.failed() with the appropriate error code and diagnostic message.
| certificateRequest | The the request with the Interest for fetching the certificate. |
| state | The validation state. |
| continueValidation | After fetching, this calls continueValidation(certificate, state) where certificate is the fetched certificate and state is the ValidationState. |
|
virtual |
Assign the certificate storage used to check for known certificates and to cache unverified ones.
| certificateStorage | The certificate storage object which must be valid for the lifetime of this CertificateFetcher. |
1.8.6