diff --git a/src/security/certificate-cache-ttl.cpp b/src/security/certificate-cache-ttl.cpp
new file mode 100644
index 0000000..f5482a3
--- /dev/null
+++ b/src/security/certificate-cache-ttl.cpp
@@ -0,0 +1,72 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "certificate-cache-ttl.hpp"
+
+#include <iostream>
+
+#include "../util/logging.hpp"
+
+
+INIT_LOGGER("CertificateCacheTtl")
+
+using namespace std;
+
+namespace ndn
+{    
+CertificateCacheTtl::CertificateCacheTtl(shared_ptr<boost::asio::io_service> io, int defaultTtl)
+  : m_defaultTtl(defaultTtl)
+  , m_scheduler(*io)
+{}
+
+CertificateCacheTtl::~CertificateCacheTtl()
+{}
+  
+void
+CertificateCacheTtl::insertCertificate(ptr_lib::shared_ptr<const IdentityCertificate> certificate)
+{
+  time::Duration expire = (certificate->getFreshnessPeriod() >= 0 ? time::milliseconds(certificate->getFreshnessPeriod()) : time::seconds(m_defaultTtl));
+
+  Name trackerIndex = certificate->getName().getPrefix(-1);
+  EventTracker::iterator it = m_tracker.find(trackerIndex);
+  if(it != m_tracker.end())
+      m_scheduler.cancelEvent(m_tracker[trackerIndex]);
+
+  m_scheduler.scheduleEvent(time::seconds(0), bind(&CertificateCacheTtl::insert, this, certificate));  
+  m_tracker[trackerIndex] = m_scheduler.scheduleEvent(expire, bind(&CertificateCacheTtl::remove, this, certificate->getName()));
+
+}
+
+void
+CertificateCacheTtl::insert(ptr_lib::shared_ptr<const IdentityCertificate> certificate)
+{ 
+  Name name = certificate->getName().getPrefix(-1);
+  m_cache[name] = certificate;
+}
+
+void
+CertificateCacheTtl::remove(const Name &certificateName)
+{
+  Name name = certificateName.getPrefix(-1);
+  Cache::iterator it = m_cache.find(name);
+  if(it != m_cache.end())
+    m_cache.erase(it);
+}
+
+ptr_lib::shared_ptr<const IdentityCertificate> 
+CertificateCacheTtl::getCertificate(const Name & certificateName)
+{
+  Cache::iterator it = m_cache.find(certificateName);
+  if(it != m_cache.end())
+    return it->second;
+  else
+    return ptr_lib::shared_ptr<IdentityCertificate>();
+}
+
+}//ndn
+
+
diff --git a/src/security/certificate-cache-ttl.hpp b/src/security/certificate-cache-ttl.hpp
new file mode 100644
index 0000000..6d5194b
--- /dev/null
+++ b/src/security/certificate-cache-ttl.hpp
@@ -0,0 +1,54 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_CERTIFICATE_CACHE_TTL_HPP
+#define NDN_CERTIFICATE_CACHE_TTL_HPP
+
+#include "certificate-cache.hpp"
+#include "../util/scheduler.hpp"
+#include "../util/time.hpp"
+
+#include <unistd.h>
+#include <map>
+
+namespace ndn
+{
+ 
+class CertificateCacheTtl : public CertificateCache
+{
+public:
+  CertificateCacheTtl(shared_ptr<boost::asio::io_service> io, int defaultTtl = 3600);
+  
+  virtual
+  ~CertificateCacheTtl();
+    
+  virtual void
+  insertCertificate(ptr_lib::shared_ptr<const IdentityCertificate> certificate);
+  
+  virtual ptr_lib::shared_ptr<const IdentityCertificate> 
+  getCertificate(const Name & certificateNameWithoutVersion);
+
+private:  
+  void
+  insert(ptr_lib::shared_ptr<const IdentityCertificate> certificate);
+  
+  void
+  remove(const Name &certificateName);
+
+protected:
+  typedef std::map<Name, ptr_lib::shared_ptr<const IdentityCertificate> > Cache;
+  typedef std::map<Name, EventId> EventTracker;
+
+  int m_defaultTtl;
+  Cache m_cache;
+  EventTracker m_tracker;
+  Scheduler m_scheduler;
+};
+
+}//ndn
+
+#endif
diff --git a/src/security/certificate-cache.hpp b/src/security/certificate-cache.hpp
new file mode 100644
index 0000000..14c42d1
--- /dev/null
+++ b/src/security/certificate-cache.hpp
@@ -0,0 +1,32 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_CERTIFICATE_CACHE_HPP
+#define NDN_CERTIFICATE_CACHE_HPP
+
+#include "../name.hpp"
+#include "identity-certificate.hpp"
+
+namespace ndn
+{
+
+class CertificateCache
+{
+public:
+  virtual
+  ~CertificateCache() {}
+    
+  virtual void
+  insertCertificate(ptr_lib::shared_ptr<const IdentityCertificate> certificate) = 0;
+
+  virtual ptr_lib::shared_ptr<const IdentityCertificate> 
+  getCertificate(const Name& certificateNameWithoutVersion) = 0;
+};
+
+}//ndn
+
+#endif
diff --git a/tests/test-certificate-cache.cpp b/tests/test-certificate-cache.cpp
new file mode 100644
index 0000000..29a45fc
--- /dev/null
+++ b/tests/test-certificate-cache.cpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi0@cs.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#include <boost/test/unit_test.hpp>
+#include <unistd.h>
+#include "security/certificate-cache-ttl.hpp"
+#include "face.hpp"
+
+using namespace std;
+using namespace ndn;
+
+
+BOOST_AUTO_TEST_SUITE(TestCertificateCache)
+
+void
+getCertificateTtl(shared_ptr<CertificateCacheTtl> cache, const Name &name, bool cached)
+{
+  BOOST_CHECK_EQUAL(static_cast<bool>(cache->getCertificate(name)), cached);
+}
+
+
+BOOST_AUTO_TEST_CASE (Ttl)
+{
+  shared_ptr<boost::asio::io_service> io = make_shared<boost::asio::io_service>();
+  shared_ptr<CertificateCacheTtl> cache = make_shared<CertificateCacheTtl>(io, 1);
+  Scheduler scheduler(*io);
+
+  shared_ptr<IdentityCertificate> cert1 = make_shared<IdentityCertificate>();
+  Name certName1("/tmp/KEY/ksk-1/ID-CERT/1");
+  cert1->setName(certName1);
+  cert1->setFreshnessPeriod(500);
+  shared_ptr<IdentityCertificate> cert2 = make_shared<IdentityCertificate>();
+  Name certName2("/tmp/KEY/ksk-2/ID-CERT/2");
+  cert2->setName(certName2);
+  cert2->setFreshnessPeriod(1000);
+
+  Name name1 = certName1.getPrefix(-1);
+  Name name2 = certName2.getPrefix(-1);
+  
+  cache->insertCertificate(cert1);
+  cache->insertCertificate(cert2);
+
+  scheduler.scheduleEvent(time::seconds(0.3), bind(&getCertificateTtl, cache, name1, true));
+  scheduler.scheduleEvent(time::seconds(0.3), bind(&getCertificateTtl, cache, name2, true));
+  scheduler.scheduleEvent(time::seconds(0.6), bind(&getCertificateTtl, cache, name1, false));
+  scheduler.scheduleEvent(time::seconds(0.6), bind(&getCertificateTtl, cache, name2, true));
+  scheduler.scheduleEvent(time::seconds(0.6), bind(&CertificateCache::insertCertificate, &*cache, cert2));
+  scheduler.scheduleEvent(time::seconds(1.3), bind(&getCertificateTtl, cache, name2, true));
+  scheduler.scheduleEvent(time::seconds(1.7), bind(&getCertificateTtl, cache, name2, false));
+
+  io->run();
+}
+
+BOOST_AUTO_TEST_SUITE_END()
