ndn::security::CertificateBundleFetcher Class Reference

Fetch certificate bundle from the network. More...

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

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

Public Types

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

Public Member Functions

 CertificateBundleFetcher (unique_ptr< CertificateFetcher > inner, Face &face)
 
void fetch (const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
 Asynchronously fetch certificate. More...
 
time::milliseconds getBundleInterestLifetime () const
 
void setBundleInterestLifetime (time::milliseconds time)
 Set the lifetime of certificate bundle Interest. More...
 
void setCertificateStorage (CertificateStorage &certStorage) override
 Set the storage for this and inner certificate fetcher. 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

Fetch certificate bundle from the network.

Currently bundle fetching is attempted only for Data validation. This may change in the future. Bundle fetching always goes to the infrastructure regardless of the inner fetcher. Inner fetcher is used when the bundle interest times out or returns a Nack or when additional certificates are needed for validation.

See also
https://redmine.named-data.net/projects/ndn-cxx/wiki/Certificate_Bundle_Packet_Format

Definition at line 40 of file certificate-bundle-fetcher.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.

Constructor & Destructor Documentation

◆ CertificateBundleFetcher()

ndn::security::CertificateBundleFetcher::CertificateBundleFetcher ( unique_ptr< CertificateFetcher inner,
Face face 
)
explicit

Definition at line 39 of file certificate-bundle-fetcher.cpp.

Member Function Documentation

◆ doFetch()

void ndn::security::CertificateBundleFetcher::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 54 of file certificate-bundle-fetcher.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.

◆ getBundleInterestLifetime()

time::milliseconds ndn::security::CertificateBundleFetcher::getBundleInterestLifetime ( ) const
inline
Returns
The lifetime of certificate bundle Interest.

Definition at line 50 of file certificate-bundle-fetcher.hpp.

◆ setBundleInterestLifetime()

void ndn::security::CertificateBundleFetcher::setBundleInterestLifetime ( time::milliseconds  time)
inline

Set the lifetime of certificate bundle Interest.

Definition at line 59 of file certificate-bundle-fetcher.hpp.

◆ setCertificateStorage()

void ndn::security::CertificateBundleFetcher::setCertificateStorage ( CertificateStorage certStorage)
overridevirtual

Set the storage for this and inner certificate fetcher.

Reimplemented from ndn::security::CertificateFetcher.

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

Member Data Documentation

◆ m_certStorage

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

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