certificate-store.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NLSR_CERTIFICATE_STORE_HPP
23 #define NLSR_CERTIFICATE_STORE_HPP
24 
25 #include "common.hpp"
26 #include "test-access-control.hpp"
27 #include "lsdb.hpp"
28 
29 #include <ndn-cxx/interest.hpp>
30 #include <ndn-cxx/mgmt/nfd/controller.hpp>
31 #include <ndn-cxx/security/v2/certificate.hpp>
32 #include <ndn-cxx/security/validator-config.hpp>
33 
34 namespace nlsr {
35 class ConfParameter;
36 namespace security {
37 
46 {
47 
48 public:
49  CertificateStore(ndn::Face& face, ConfParameter& confParam, Lsdb& lsdb);
50 
51  void
52  insert(const ndn::security::v2::Certificate& certificate);
53 
62  const ndn::security::v2::Certificate*
63  find(const ndn::Name& keyName) const;
64 
69  void
70  publishCertFromCache(const ndn::Name& keyName);
71 
72  void
73  afterFetcherSignalEmitted(const ndn::Data& lsaSegment);
74 
76  void
77  clear();
78 
79  void
80  setInterestFilter(const ndn::Name& prefix, const bool loopback = false);
81 
82  void
83  registerKeyPrefixes();
84 
85  void
86  onKeyInterest(const ndn::Name& name, const ndn::Interest& interest);
87 
88  void
89  onKeyPrefixRegSuccess(const ndn::Name& name);
90 
91  void
92  registrationFailed(const ndn::Name& name);
93 
94 private:
95  typedef std::map<ndn::Name, ndn::security::v2::Certificate> CertMap;
96  CertMap m_certificates;
97  ndn::Face& m_face;
98  ConfParameter& m_confParam;
99  Lsdb& m_lsdb;
100  ndn::security::ValidatorConfig& m_validator;
101  ndn::util::signal::ScopedConnection m_afterSegmentValidatedConnection;
102 };
103 
104 } // namespace security
105 } // namespace nlsr
106 
107 #endif // NLSR_CERTIFICATE_STORE_HPP
A class to house all the configuration parameters for NLSR.
Store certificates for names.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
CertificateStore(ndn::Face &face, ConfParameter &confParam, Lsdb &lsdb)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
void publishCertFromCache(const ndn::Name &keyName)
Retrieves the chain of certificates from Validator&#39;s cache and store them in Nlsr&#39;s own CertificateSt...
void insert(const ndn::security::v2::Certificate &certificate)
Copyright (c) 2014-2019, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void afterFetcherSignalEmitted(const ndn::Data &lsaSegment)
const ndn::security::v2::Certificate * find(const ndn::Name &keyName) const
Find a certificate.