security: refactor CertificateStore class

Refs: #5075

Change-Id: I8ab92012b3acf405503ab33c9320463accc682a9
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index dc422f5..b893bf8 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -152,6 +152,12 @@
   }
   ret = load(inputFile);
   inputFile.close();
+
+  if (ret) {
+    m_confParam.buildRouterAndSyncUserPrefix();
+    m_confParam.writeLog();
+  }
+
   return ret;
 }
 
@@ -656,12 +662,8 @@
         std::cerr << "Error: Cannot load cert-to-publish: " << file << "!" << std::endl;
         return false;
       }
-
-      m_confParam.getCertStore().insert(*idCert);
-      m_confParam.getValidator().loadAnchor("Authoritative-Certificate",
-                                            ndn::security::v2::Certificate(*idCert));
-      m_confParam.getPrefixUpdateValidator().loadAnchor("Authoritative-Certificate",
-                                                        ndn::security::v2::Certificate(*idCert));
+      m_confParam.addCertPath(certfilePath.string());
+      m_confParam.loadCertToValidator(*idCert);
     }
   }