blob: 873f6b0e4d48e8d56b3dcb35508495cd67a3e254 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Davide Pesaventocdcde902017-08-23 15:40:22 -04002/*
Davide Pesavento25d4f1c2020-04-29 23:31:04 -04003 * Copyright (c) 2013-2020 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library 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 Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Yingdi Yu8d7468f2014-02-21 14:49:45 -080020 */
21
Alexander Afanasyevd7db8bf2015-01-04 15:31:02 -080022#ifndef NDN_TOOLS_NDNSEC_UTIL_HPP
23#define NDN_TOOLS_NDNSEC_UTIL_HPP
Yingdi Yu8d7468f2014-02-21 14:49:45 -080024
Davide Pesavento7e780642018-11-24 15:51:34 -050025#include "ndn-cxx/security/key-chain.hpp"
Yingdi Yu8d7468f2014-02-21 14:49:45 -080026
Alexander Afanasyev82c359c2017-01-04 14:48:07 -080027#include <iostream>
Alexander Afanasyev82c359c2017-01-04 14:48:07 -080028
Alexander Afanasyev82c359c2017-01-04 14:48:07 -080029#include <boost/program_options/options_description.hpp>
30#include <boost/program_options/parsers.hpp>
31#include <boost/program_options/variables_map.hpp>
Alexander Afanasyev82c359c2017-01-04 14:48:07 -080032
33namespace ndn {
34namespace ndnsec {
35
Alexander Afanasyev35109a12017-01-04 15:39:06 -080036class CannotLoadCertificate : public std::runtime_error
37{
38public:
39 CannotLoadCertificate(const std::string& msg)
40 : std::runtime_error(msg)
41 {
42 }
43};
Yingdi Yu8d7468f2014-02-21 14:49:45 -080044
Alexander Afanasyev35109a12017-01-04 15:39:06 -080045security::v2::Certificate
46loadCertificate(const std::string& fileName);
Yingdi Yu3e8b52e2014-11-26 22:05:00 -080047
Davide Pesavento25d4f1c2020-04-29 23:31:04 -040048bool
49getPassword(std::string& password, const std::string& prompt, bool shouldConfirm = true);
Yingdi Yu3e8b52e2014-11-26 22:05:00 -080050
Alexander Afanasyev82c359c2017-01-04 14:48:07 -080051} // namespace ndnsec
52} // namespace ndn
53
Alexander Afanasyevd7db8bf2015-01-04 15:31:02 -080054#endif // NDN_TOOLS_NDNSEC_UTIL_HPP