update ca storage
Change-Id: I4fcce728d24183e8c2961c1beb4704f524391e5c
diff --git a/tools/ndncert-ca-server.cpp b/tools/ndncert-ca-server.cpp
index 0786654..a3e1c1f 100644
--- a/tools/ndncert-ca-server.cpp
+++ b/tools/ndncert-ca-server.cpp
@@ -25,9 +25,6 @@
#include <ndn-cxx/security/key-chain.hpp>
#include <boost/asio/ip/tcp.hpp>
-#if BOOST_VERSION < 106700
-#include <boost/date_time/posix_time/posix_time_duration.hpp>
-#endif
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
@@ -98,6 +95,9 @@
}
});
}
+ else {
+
+ }
face.processEvents();
return 0;
diff --git a/tools/ndncert-ca-status.cpp b/tools/ndncert-ca-status.cpp
index e8ca561..1b3d75e 100644
--- a/tools/ndncert-ca-status.cpp
+++ b/tools/ndncert-ca-status.cpp
@@ -33,10 +33,10 @@
{
namespace po = boost::program_options;
std::string caNameString = "";
- po::options_description description("General Usage\n ndncert-ca [-h] [-f] configFilePath-file\n");
+ po::options_description description("General Usage\n ndncert-ca-status [-h] CA_NAME\n");
description.add_options()
("help,h", "produce help message")
- ("CAName,c", po::value<std::string>(&caNameString), "ca name");
+ ("CA_NAME", po::value<std::string>(&caNameString), "ca name");
po::positional_options_description p;
po::variables_map vm;
try {
@@ -51,26 +51,18 @@
std::cerr << description << std::endl;
return 0;
}
+ if (vm.count("CA_NAME") == 0) {
+ std::cerr << "ERROR: you must specify a CA identity." << std::endl;
+ return 2;
+ }
- CaSqlite storage;
+ CaSqlite storage(Name(caNameString), "");
std::list<CaState> requestList;
- std::list<security::v2::Certificate> certList;
- if (caNameString != "") {
- requestList = storage.listAllRequests(Name(caNameString));
- certList = storage.listAllIssuedCertificates(Name(caNameString));
- }
- else {
- requestList = storage.listAllRequests();
- certList = storage.listAllIssuedCertificates();
- }
- std::cerr << "The pending requests :" << std::endl;
+ requestList = storage.listAllRequests();
+ std::cerr << "The pending requests are :" << std::endl;
for (const auto& entry : requestList) {
std::cerr << entry;
}
- std::cerr << "\n\nThe issued certs :" << std::endl;
- for (const auto& entry : certList) {
- std::cerr << entry.getName().toUri() << std::endl;
- }
return 0;
}