ndn::security::CertificateFetcherOffline Class Reference

Certificate fetcher realization that does not fetch keys (always offline) More...

#include <ndn-cxx/security/certificate-fetcher-offline.hpp>

+ Inheritance diagram for ndn::security::CertificateFetcherOffline:
+ Collaboration diagram for ndn::security::CertificateFetcherOffline:

Public Types

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

Public Member Functions

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 > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
 Asynchronous certificate fetching implementation. More...
 

Protected Attributes

CertificateStoragem_certStorage
 

Detailed Description

Certificate fetcher realization that does not fetch keys (always offline)

Definition at line 32 of file certificate-fetcher-offline.hpp.

Member Typedef Documentation

◆ ValidationContinuation

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

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

Member Function Documentation

◆ doFetch()

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

Asynchronous certificate fetching implementation.

Implements ndn::security::CertificateFetcher.

Definition at line 29 of file certificate-fetcher-offline.cpp.

◆ fetch()

void ndn::security::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 48 of file certificate-fetcher.cpp.

◆ setCertificateStorage()

void ndn::security::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::CertificateBundleFetcher.

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

Member Data Documentation

◆ m_certStorage

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

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