NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
certificate-cache-ttl.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
24 #ifndef NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
25 #define NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
26 
27 #include "../common.hpp"
28 #include "certificate-cache.hpp"
29 #include "../util/scheduler.hpp"
30 
31 namespace ndn {
32 namespace security {
33 
41 {
42 public:
43  explicit
44  CertificateCacheTtl(boost::asio::io_service& io,
45  const time::seconds& defaultTtl = time::seconds(3600));
46 
47  virtual
49 
50  virtual void
51  insertCertificate(shared_ptr<const v1::IdentityCertificate> certificate);
52 
53  virtual shared_ptr<const v1::IdentityCertificate>
54  getCertificate(const Name& certificateNameWithoutVersion);
55 
56  virtual void
57  reset();
58 
59  virtual size_t
60  getSize();
61 
62 private:
63  void
64  insert(shared_ptr<const v1::IdentityCertificate> certificate);
65 
66  void
67  remove(const Name& certificateName);
68 
69  void
70  removeAll();
71 
72 protected:
73  typedef std::map<Name, std::pair<shared_ptr<const v1::IdentityCertificate>, EventId> > Cache;
74 
75  time::seconds m_defaultTtl;
76  Cache m_cache;
78 };
79 
80 } // namespace security
81 
83 
84 } // namespace ndn
85 
86 #endif // NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
Copyright (c) 2011-2015 Regents of the University of California.
CertificateCacheTtl(boost::asio::io_service &io, const time::seconds &defaultTtl=time::seconds(3600))
std::map< Name, std::pair< shared_ptr< const v1::IdentityCertificate >, EventId > > Cache
virtual void insertCertificate(shared_ptr< const v1::IdentityCertificate > certificate)
Cache of validated certificates with freshness-based eviction policy.
std::shared_ptr< ns3::EventId > EventId
Definition: scheduler.hpp:39
Name abstraction to represent an absolute name.
Definition: name.hpp:46
virtual shared_ptr< const v1::IdentityCertificate > getCertificate(const Name &certificateNameWithoutVersion)
Interface for the cache of validated certificates.