blob: eeb33971b8ee052f47666b6e6d2271c202be859e [file] [log] [blame]
Zhiyi Zhangf5246c42017-01-26 09:39:20 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Davide Pesaventob48bbda2020-07-27 19:41:37 -04002/*
3 * Copyright (c) 2017-2020, Regents of the University of California.
Zhiyi Zhangf5246c42017-01-26 09:39:20 -08004 *
5 * This file is part of ndncert, a certificate management system based on NDN.
6 *
7 * ndncert is free software: you can redistribute it and/or modify it under the terms
8 * of the GNU General Public License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License along with
16 * ndncert, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * See AUTHORS.md for complete list of ndncert authors and contributors.
19 */
20
21#ifndef NDNCERT_CA_DETAIL_CA_MEMORY_HPP
22#define NDNCERT_CA_DETAIL_CA_MEMORY_HPP
23
24#include "../ca-storage.hpp"
25
26namespace ndn {
27namespace ndncert {
28
29class CaMemory : public CaStorage
30{
31public:
Zhiyi Zhangd1d9f5a2020-10-05 18:04:23 -070032 CaMemory(const Name& caName = Name(), const std::string& path = "");
Zhiyi Zhangf5246c42017-01-26 09:39:20 -080033 const static std::string STORAGE_TYPE;
34
35public:
36 // certificate request related
tylerliu8704d032020-06-23 10:18:15 -070037 CaState
Zhiyi Zhangf5246c42017-01-26 09:39:20 -080038 getRequest(const std::string& requestId) override;
39
40 void
tylerliu8704d032020-06-23 10:18:15 -070041 addRequest(const CaState& request) override;
Zhiyi Zhangf5246c42017-01-26 09:39:20 -080042
43 void
tylerliu8704d032020-06-23 10:18:15 -070044 updateRequest(const CaState& request) override;
Zhiyi Zhangf5246c42017-01-26 09:39:20 -080045
46 void
47 deleteRequest(const std::string& requestId) override;
48
tylerliu8704d032020-06-23 10:18:15 -070049 std::list<CaState>
Zhiyi Zhangae123bf2017-04-14 12:24:53 -070050 listAllRequests() override;
51
tylerliu8704d032020-06-23 10:18:15 -070052 std::list<CaState>
Zhiyi Zhangae123bf2017-04-14 12:24:53 -070053 listAllRequests(const Name& caName) override;
54
Zhiyi Zhangf5246c42017-01-26 09:39:20 -080055private:
Zhiyi Zhangd1d9f5a2020-10-05 18:04:23 -070056 std::map<Name, CaState> m_requests;
Zhiyi Zhangf5246c42017-01-26 09:39:20 -080057};
58
59} // namespace ndncert
60} // namespace ndn
61
62#endif // NDNCERT_CA_DETAIL_CA_MEMORY_HPP