All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
certificate-cache-ttl.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
8 #ifndef NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
9 #define NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
10 
11 #include "../common.hpp"
12 #include "certificate-cache.hpp"
13 #include "../util/scheduler.hpp"
14 
15 namespace ndn {
16 
18 {
19 public:
20  CertificateCacheTtl(shared_ptr<boost::asio::io_service> io,
21  const time::seconds& defaultTtl = time::seconds(3600));
22 
23  virtual
25 
26  virtual void
27  insertCertificate(shared_ptr<const IdentityCertificate> certificate);
28 
29  virtual shared_ptr<const IdentityCertificate>
30  getCertificate(const Name& certificateNameWithoutVersion);
31 
32 private:
33  void
34  insert(shared_ptr<const IdentityCertificate> certificate);
35 
36  void
37  remove(const Name& certificateName);
38 
39 protected:
40  typedef std::map<Name, shared_ptr<const IdentityCertificate> > Cache;
41  typedef std::map<Name, EventId> EventTracker;
42 
43  time::seconds m_defaultTtl;
47 };
48 
49 } // namespace ndn
50 
51 #endif //NDN_SECURITY_CERTIFICATE_CACHE_TTL_HPP
virtual void insertCertificate(shared_ptr< const IdentityCertificate > certificate)
CertificateCacheTtl(shared_ptr< boost::asio::io_service > io, const time::seconds &defaultTtl=time::seconds(3600))
Generic scheduler.
Definition: scheduler.hpp:24
std::map< Name, shared_ptr< const IdentityCertificate > > Cache
std::map< Name, EventId > EventTracker
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:26
virtual shared_ptr< const IdentityCertificate > getCertificate(const Name &certificateNameWithoutVersion)