blob: fbb703bca5ade31a66aabf13d782bbeec282a774 [file] [log] [blame]
Zhiyi Zhang32dbb9f2017-02-16 15:15:10 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2017, Regents of the University of California.
4 *
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_CLIENT_CONFIG_HPP
22#define NDNCERT_CLIENT_CONFIG_HPP
23
24#include "ca-config.hpp"
25#include <boost/filesystem.hpp>
26
27namespace ndn {
28namespace ndncert {
29
Zhiyi Zhang32dbb9f2017-02-16 15:15:10 -080030class ClientConfig
31{
32public:
33 class Error : public std::runtime_error
34 {
35 public:
36 using std::runtime_error::runtime_error;
37 };
38
39public:
40 void
41 load(const std::string& fileName);
42
43 void
44 addNewCaItem(const CaItem& item);
45
46 void
47 removeCaItem(const Name& caName);
48
49PUBLIC_WITH_TESTS_ELSE_PRIVATE:
50 void
51 parse();
52
53 std::list<std::string>
54 parseChallengeList(const ConfigSection& section);
55
56public:
57 std::list<CaItem> m_caItems;
58
59PUBLIC_WITH_TESTS_ELSE_PRIVATE:
60 ConfigSection m_config;
61};
62
63} // namespace ndncert
64} // namespace ndn
65
66#endif // NDNCERT_CLIENT_CONFIG_HPP