29 const time::seconds& defaultTtl)
30 : m_defaultTtl(defaultTtl)
45 shared_ptr<const IdentityCertificate>
50 return it->second.first;
52 return shared_ptr<IdentityCertificate>();
68 CertificateCacheTtl::insert(shared_ptr<const IdentityCertificate> certificate)
70 time::milliseconds expire = (certificate->getFreshnessPeriod() >= time::seconds::zero() ?
80 bind(&CertificateCacheTtl::remove,
81 this, certificate->getName()));
83 m_cache[index] = std::make_pair(certificate, eventId);
87 CertificateCacheTtl::remove(
const Name& certificateName)
89 Name name = certificateName.getPrefix(-1);
96 CertificateCacheTtl::removeAll()
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix (PartialName) of the name, containing first nComponents components.
Copyright (c) 2011-2015 Regents of the University of California.
virtual void insertCertificate(shared_ptr< const IdentityCertificate > certificate)
EventId scheduleEvent(const time::nanoseconds &after, const Event &event)
Schedule one time event after the specified delay.
void cancelEvent(const EventId &eventId)
Cancel scheduled event.
std::shared_ptr< ns3::EventId > EventId
Table::const_iterator iterator
virtual ~CertificateCacheTtl()
Name abstraction to represent an absolute name.
virtual shared_ptr< const IdentityCertificate > getCertificate(const Name &certificateNameWithoutVersion)
CertificateCacheTtl(boost::asio::io_service &io, const time::seconds &defaultTtl=time::seconds(3600))
time::seconds m_defaultTtl