All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ndn::CertificateFetcher Class Referenceabstract

CertificateFetcher is an abstract base class which provides an interface used by the validator to fetch missing certificates. More...

#include <certificate-fetcher.hpp>

Inheritance diagram for ndn::CertificateFetcher:
ndn::CertificateFetcherFromNetwork ndn::CertificateFetcherOffline

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

CertificateStoragecertificateStorage_
 

Detailed Description

CertificateFetcher is an abstract base class which provides an interface used by the validator to fetch missing certificates.

Member Function Documentation

virtual void ndn::CertificateFetcher::doFetch ( const ptr_lib::shared_ptr< CertificateRequest > &  certificateRequest,
const ptr_lib::shared_ptr< ValidationState > &  state,
const ValidationContinuation &  continueValidation 
)
protectedpure virtual

An implementation to fetch a certificate asynchronously.

The subclass must implement this method.

Parameters
certificateRequestThe the request with the Interest for fetching the certificate.
stateThe validation state.
continueValidationAfter 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.

Parameters
certificateRequestThe the request with the Interest for fetching the certificate.
stateThe validation state.
continueValidationAfter fetching, this calls continueValidation(certificate, state) where certificate is the fetched certificate and state is the ValidationState.
void ndn::CertificateFetcher::setCertificateStorage ( CertificateStorage certificateStorage)
virtual

Assign the certificate storage used to check for known certificates and to cache unverified ones.

Parameters
certificateStorageThe certificate storage object which must be valid for the lifetime of this CertificateFetcher.

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