NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::v2::CertificateFetcher Class Referenceabstract

Interface used by the validator to fetch missing certificates. More...

#include <certificate-fetcher.hpp>

Inheritance diagram for ndn::security::v2::CertificateFetcher:
Collaboration diagram for ndn::security::v2::CertificateFetcher:

Public Types

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

Public Member Functions

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

Protected Attributes

CertificateStoragem_certStorage
 

Detailed Description

Interface used by the validator to fetch missing certificates.

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

Member Typedef Documentation

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

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

Constructor & Destructor Documentation

ndn::security::v2::CertificateFetcher::CertificateFetcher ( )

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

References ~CertificateFetcher().

ndn::security::v2::CertificateFetcher::~CertificateFetcher ( )
virtualdefault

Referenced by CertificateFetcher().

Member Function Documentation

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

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.

References m_certStorage.

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

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.

References ndn::security::v2::CertificateStorage::cacheUnverifiedCert(), ndn::security::v2::CertificateCache::find(), ndn::security::v2::CertificateStorage::getUnverifiedCertCache(), m_certStorage, and NDN_LOG_DEBUG_DEPTH.

Referenced by ndn::security::v2::CertificateFetcherFromNetwork::doFetch().

Member Data Documentation


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