ndn::security::v2::CertificateFetcherDirectFetch Class Reference

Extends CertificateFetcherFromNetwork to fetch certificates from Interest sender. More...

#include <certificate-fetcher-direct-fetch.hpp>

+ Inheritance diagram for ndn::security::v2::CertificateFetcherDirectFetch:
+ Collaboration diagram for ndn::security::v2::CertificateFetcherDirectFetch:

Public Types

using ValidationContinuation = std::function< void(const Certificate &cert, const shared_ptr< ValidationState > &state)>
 

Public Member Functions

 CertificateFetcherDirectFetch (Face &face)
 
void fetch (const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
 Asynchronously fetch certificate. More...
 
virtual void setCertificateStorage (CertificateStorage &certStorage)
 Assign certificate storage to check known certificate and to cache unverified ones. More...
 

Protected Member Functions

void doFetch (const shared_ptr< CertificateRequest > &keyRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
 Asynchronous certificate fetching implementation. More...
 

Protected Attributes

CertificateStoragem_certStorage
 
Facem_face
 

Detailed Description

Extends CertificateFetcherFromNetwork to fetch certificates from Interest sender.

During Interest validation, if IncomingFaceId tag is present on the original Interest, this fetcher will send a "direct Interest" to fetch certificates from the face where the original Interest was received, in addition to fetching from the infrastructure. The application must enable NextHopFaceId privilege on the face used by this fetcher prior to the validation.

During Data validation, this fetcher is equivalent to CertificateFetcherFromNetwork.

Definition at line 41 of file certificate-fetcher-direct-fetch.hpp.

Member Typedef Documentation

using ndn::security::v2::CertificateFetcher::ValidationContinuation = std::function<void(const Certificate& cert, const shared_ptr<ValidationState>& state)>
inherited

Definition at line 43 of file certificate-fetcher.hpp.

Constructor & Destructor Documentation

ndn::security::v2::CertificateFetcherDirectFetch::CertificateFetcherDirectFetch ( Face face)
explicit

Definition at line 30 of file certificate-fetcher-direct-fetch.cpp.

Member Function Documentation

void ndn::security::v2::CertificateFetcherDirectFetch::doFetch ( const shared_ptr< CertificateRequest > &  certRequest,
const shared_ptr< ValidationState > &  state,
const ValidationContinuation continueValidation 
)
overrideprotectedvirtual

Asynchronous certificate fetching implementation.

Implements ndn::security::v2::CertificateFetcher.

Definition at line 36 of file certificate-fetcher-direct-fetch.cpp.

void ndn::security::v2::CertificateFetcher::fetch ( const shared_ptr< CertificateRequest > &  certRequest,
const shared_ptr< ValidationState > &  state,
const ValidationContinuation continueValidation 
)
inherited

Asynchronously fetch certificate.

Precondition
m_certStorage != nullptr

If the requested certificate exists in the storage, then this method will immediately call continueValidation with the certification. If certificate is not available, the implementation-specific doFetch will be called to asynchronously fetch 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 call state->failed() with the appropriate error code and diagnostic message.

Definition at line 47 of file certificate-fetcher.cpp.

void ndn::security::v2::CertificateFetcher::setCertificateStorage ( CertificateStorage certStorage)
virtualinherited

Assign certificate storage to check known certificate and to cache unverified ones.

Note
The supplied certStorage should be valid for the lifetime of CertificateFetcher

Reimplemented in ndn::security::v2::CertificateBundleFetcher.

Definition at line 41 of file certificate-fetcher.cpp.

Member Data Documentation

CertificateStorage* ndn::security::v2::CertificateFetcher::m_certStorage
protectedinherited

Definition at line 84 of file certificate-fetcher.hpp.

Face& ndn::security::v2::CertificateFetcherFromNetwork::m_face
protectedinherited

Definition at line 81 of file certificate-fetcher-from-network.hpp.