blob: c22de679477e042f099d986bc2b61ce87baf2ae9 [file] [log] [blame]
Yingdi Yu7640cb32014-01-29 20:00:50 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07003 * Copyright (c) 2013-2014, Regents of the University of California.
4 * All rights reserved.
5 *
6 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
7 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
8 *
9 * This file licensed under New BSD License. See COPYING for detailed information about
10 * ndn-cxx library copyright, permissions, and redistribution restrictions.
11 *
12 * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
Yingdi Yu7640cb32014-01-29 20:00:50 -080013 */
14
Yingdi Yufc40d872014-02-18 12:56:04 -080015#ifndef NDN_SECURITY_CERTIFICATE_CACHE_HPP
16#define NDN_SECURITY_CERTIFICATE_CACHE_HPP
Yingdi Yu7640cb32014-01-29 20:00:50 -080017
18#include "../name.hpp"
19#include "identity-certificate.hpp"
20
Yingdi Yufc40d872014-02-18 12:56:04 -080021namespace ndn {
Yingdi Yu7640cb32014-01-29 20:00:50 -080022
23class CertificateCache
24{
25public:
26 virtual
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070027 ~CertificateCache()
28 {
29 }
Yingdi Yu7640cb32014-01-29 20:00:50 -080030
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070031 virtual void
32 insertCertificate(shared_ptr<const IdentityCertificate> certificate) = 0;
33
34 virtual shared_ptr<const IdentityCertificate>
Yingdi Yu7640cb32014-01-29 20:00:50 -080035 getCertificate(const Name& certificateNameWithoutVersion) = 0;
Yingdi Yu58f33712014-04-16 16:57:47 -070036
37 virtual void
38 reset() = 0;
39
40 virtual size_t
41 getSize() = 0;
42
43 bool
44 isEmpty()
45 {
46 return (getSize() == 0);
47 }
Yingdi Yu7640cb32014-01-29 20:00:50 -080048};
49
Yingdi Yufc40d872014-02-18 12:56:04 -080050} // namespace ndn
Yingdi Yu7640cb32014-01-29 20:00:50 -080051
Yingdi Yufc40d872014-02-18 12:56:04 -080052#endif //NDN_SECURITY_CERTIFICATE_CACHE_HPP