security: refactor CertificateStore class
Refs: #5075
Change-Id: I8ab92012b3acf405503ab33c9320463accc682a9
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 7848676..702c4f5 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -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.
*
@@ -27,9 +27,7 @@
#include "test-access-control.hpp"
#include "adjacency-list.hpp"
#include "name-prefix-list.hpp"
-#include "security/certificate-store.hpp"
-#include <iostream>
#include <boost/cstdint.hpp>
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/validator-config.hpp>
@@ -132,7 +130,8 @@
{
public:
- ConfParameter(ndn::Face& face, const std::string& confFileName = "nlsr.conf");
+ ConfParameter(ndn::Face& face, ndn::KeyChain& keyChain,
+ const std::string& confFileName = "nlsr.conf");
const std::string&
getConfFileName()
@@ -455,12 +454,36 @@
return m_prefixUpdateValidator;
}
- security::CertificateStore&
- getCertStore()
+ const ndn::security::SigningInfo&
+ getSigningInfo() const
{
- return m_certStore;
+ return m_signingInfo;
}
+ void
+ addCertPath(const std::string& certPath)
+ {
+ m_certs.insert(certPath);
+ }
+
+ const std::unordered_set<std::string>&
+ getIdCerts() const
+ {
+ return m_certs;
+ }
+
+ const ndn::KeyChain&
+ getKeyChain() const
+ {
+ return m_keyChain;
+ }
+
+ shared_ptr<ndn::security::v2::Certificate>
+ initializeKey();
+
+ void
+ loadCertToValidator(const ndn::security::v2::Certificate& cert);
+
/*! \brief Dump the current state of all attributes to the log.
*/
void
@@ -515,7 +538,9 @@
NamePrefixList m_npl;
ndn::security::ValidatorConfig m_validator;
ndn::security::ValidatorConfig m_prefixUpdateValidator;
- security::CertificateStore m_certStore;
+ ndn::security::SigningInfo m_signingInfo;
+ std::unordered_set<std::string> m_certs;
+ ndn::KeyChain& m_keyChain;
};
} // namespace nlsr