Loading...
Searching...
No Matches
certificate-store.hpp
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014-2024, The University of Memphis,
4 * Regents of the University of California,
5 * Arizona Board of Regents.
6 *
7 * This file is part of NLSR (Named-data Link State Routing).
8 * See AUTHORS.md for complete list of NLSR authors and contributors.
9 *
10 * NLSR is free software: you can redistribute it and/or modify it under the terms
11 * of the GNU General Public License as published by the Free Software Foundation,
12 * either version 3 of the License, or (at your option) any later version.
13 *
14 * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef NLSR_CERTIFICATE_STORE_HPP
23#define NLSR_CERTIFICATE_STORE_HPP
24
25#include <ndn-cxx/face.hpp>
26#include <ndn-cxx/interest.hpp>
27#include <ndn-cxx/security/certificate.hpp>
28#include <ndn-cxx/security/validator-config.hpp>
29#include <ndn-cxx/util/signal/scoped-connection.hpp>
30
31namespace nlsr {
32
33class ConfParameter;
34class Lsdb;
35
36namespace security {
37
46{
47public:
48 CertificateStore(ndn::Face& face, ConfParameter& confParam, Lsdb& lsdb);
49
50 void
51 insert(const ndn::security::Certificate& certificate);
52
63 const ndn::security::Certificate*
64 find(const ndn::Name& name) const;
65
70 void
71 publishCertFromCache(const ndn::Name& keyName);
72
73private:
74 const ndn::security::Certificate*
75 findByKeyName(const ndn::Name& keyName) const;
76
77 const ndn::security::Certificate*
78 findByCertName(const ndn::Name& certName) const;
79
80 void
81 setInterestFilter(const ndn::Name& prefix);
82
83 void
84 registerKeyPrefixes();
85
86 void
87 onKeyInterest(const ndn::Name& name, const ndn::Interest& interest);
88
89 void
90 onKeyPrefixRegSuccess(const ndn::Name& name);
91
92 void
93 registrationFailed(const ndn::Name& name);
94
95private:
96 std::map<ndn::Name, ndn::security::Certificate> m_certificates;
97 ndn::Face& m_face;
98 ConfParameter& m_confParam;
99 ndn::security::ValidatorConfig& m_validator;
100 ndn::signal::ScopedConnection m_afterSegmentValidatedConn;
101};
102
103} // namespace security
104} // namespace nlsr
105
106#endif // NLSR_CERTIFICATE_STORE_HPP
A class to house all the configuration parameters for NLSR.
Store certificates for names.
const ndn::security::Certificate * find(const ndn::Name &name) const
Find a certificate.
void insert(const ndn::security::Certificate &certificate)
void publishCertFromCache(const ndn::Name &keyName)
Retrieves the chain of certificates from Validator's cache and store them in Nlsr's own CertificateSt...
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.