All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
ndn::CertificateCacheV2 Class Reference

A CertificateCacheV2 holds other user's verified certificates in security v2 format CertificateV2. More...

#include <certificate-cache-v2.hpp>

Public Member Functions

 CertificateCacheV2 (Milliseconds maxLifetimeMilliseconds=getDefaultLifetime())
 Create a CertificateCacheV2. More...
 
void insert (const CertificateV2 &certificate)
 Insert the certificate into the cache. More...
 
ptr_lib::shared_ptr
< CertificateV2
find (const Name &certificatePrefix) const
 Find the certificate by the given key name. More...
 
ptr_lib::shared_ptr
< CertificateV2
find (const Interest &interest) const
 Find the certificate by the given interest. More...
 
void deleteCertificate (const Name &certificateName)
 Remove the certificate whose name equals the given name. More...
 
void clear ()
 Clear all certificates from the cache.
 
void setNowOffsetMilliseconds_ (Milliseconds nowOffsetMilliseconds)
 Set the offset when insert() and refresh() get the current time, which should only be used for testing. More...
 

Static Public Member Functions

static Milliseconds getDefaultLifetime ()
 Get the default maximum lifetime (1 hour). More...
 

Detailed Description

A CertificateCacheV2 holds other user's verified certificates in security v2 format CertificateV2.

A certificate is removed no later than its NotAfter time, or maxLifetime after it has been added to the cache.

Constructor & Destructor Documentation

ndn::CertificateCacheV2::CertificateCacheV2 ( Milliseconds  maxLifetimeMilliseconds = getDefaultLifetime())

Create a CertificateCacheV2.

Parameters
maxLifetimeMilliseconds(optional) The maximum time that certificates can live inside the cache, in milliseconds. If omitted, use getDefaultLifetime().

Member Function Documentation

void ndn::CertificateCacheV2::deleteCertificate ( const Name certificateName)

Remove the certificate whose name equals the given name.

If no such certificate is in the cache, do nothing.

Parameters
certificateNameThe name of the certificate.
ptr_lib::shared_ptr< CertificateV2 > ndn::CertificateCacheV2::find ( const Name certificatePrefix) const

Find the certificate by the given key name.

Parameters
certificatePrefixThe certificate prefix for searching for the certificate.
Returns
The found certificate, or null if not found. You must not modify the returned object. If you need to modify it, then make a copy.
ptr_lib::shared_ptr< CertificateV2 > ndn::CertificateCacheV2::find ( const Interest interest) const

Find the certificate by the given interest.

Parameters
interestThe input interest object.
Returns
The found certificate which matches the interest, or null if not found. You must not modify the returned object. If you need to modify it, then make a copy.
Note
ChildSelector is not supported.
static Milliseconds ndn::CertificateCacheV2::getDefaultLifetime ( )
inlinestatic

Get the default maximum lifetime (1 hour).

Returns
The lifetime in milliseconds.
void ndn::CertificateCacheV2::insert ( const CertificateV2 certificate)

Insert the certificate into the cache.

The inserted certificate will be removed no later than its NotAfter time, or maxLifetimeMilliseconds given to the constructor.

Parameters
certificateThe certificate object, which is copied.
void ndn::CertificateCacheV2::setNowOffsetMilliseconds_ ( Milliseconds  nowOffsetMilliseconds)
inline

Set the offset when insert() and refresh() get the current time, which should only be used for testing.

Parameters
nowOffsetMillisecondsThe offset in milliseconds.

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