NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
certificate-container.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2021 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_CXX_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
23
#define NDN_CXX_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
24
25
#include "
ndn-cxx/security/certificate.hpp
"
26
27
#include <iterator>
28
#include <set>
29
#include <unordered_map>
30
31
namespace
ndn
{
32
namespace
security
{
33
namespace
pib {
34
35
class
PibImpl;
36
37
namespace
detail {
38
class
KeyImpl
;
39
}
// namespace detail
40
47
class
CertificateContainer
: noncopyable
48
{
49
public
:
50
class
const_iterator
51
{
52
public
:
53
using
iterator_category
= std::forward_iterator_tag;
54
using
value_type
=
const
Certificate;
55
using
difference_type
= std::ptrdiff_t;
56
using
pointer
=
value_type
*;
57
using
reference
=
value_type
&;
58
59
const_iterator
();
60
61
Certificate
62
operator*();
63
64
const_iterator
&
65
operator++();
66
67
const_iterator
68
operator++(
int
);
69
70
bool
71
operator==
(
const
const_iterator
& other)
const
;
72
73
bool
74
operator!=
(
const
const_iterator
& other)
const
;
75
76
private
:
77
const_iterator
(std::set<Name>::const_iterator it,
const
CertificateContainer
& container);
78
79
private
:
80
std::set<Name>::const_iterator m_it;
81
const
CertificateContainer
* m_container;
82
83
friend
class
CertificateContainer
;
84
};
85
86
using
iterator
=
const_iterator
;
87
88
public
:
89
const_iterator
90
begin()
const
;
91
92
const_iterator
93
end()
const
;
94
95
const_iterator
96
find(
const
Name
& certName)
const
;
97
98
size_t
99
size
()
const
;
100
105
void
106
add(
const
Certificate& certificate);
107
112
void
113
remove
(
const
Name
& certName);
114
120
Certificate
121
get
(
const
Name
& certName)
const
;
122
127
bool
128
isConsistent()
const
;
129
130
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
135
CertificateContainer
(
const
Name
& keyName, shared_ptr<PibImpl> pibImpl);
136
137
const
std::set<Name>&
138
getCertNames
()
const
139
{
140
return
m_certNames;
141
}
142
143
const
std::unordered_map<Name, Certificate>&
144
getCache
()
const
145
{
146
return
m_certs;
147
}
148
149
private
:
150
Name
m_keyName;
151
std::set<Name> m_certNames;
153
mutable
std::unordered_map<Name, Certificate> m_certs;
154
155
shared_ptr<PibImpl> m_pib;
156
157
#ifndef DOXYGEN
158
friend
detail::KeyImpl
;
159
#endif
160
};
161
162
}
// namespace pib
163
164
using
pib::CertificateContainer
;
165
166
}
// namespace security
167
}
// namespace ndn
168
169
#endif // NDN_CXX_SECURITY_PIB_CERTIFICATE_CONTAINER_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::pib::operator==
bool operator==(const Identity &lhs, const Identity &rhs)
Definition:
identity.hpp:167
ndn::security::pib::CertificateContainer::const_iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition:
certificate-container.hpp:53
ndn::security::pib::CertificateContainer::const_iterator
Definition:
certificate-container.hpp:50
ndn::security::pib::CertificateContainer::getCertNames
const std::set< Name > & getCertNames() const
Definition:
certificate-container.hpp:138
ndn::security::pib::CertificateContainer::const_iterator::reference
value_type & reference
Definition:
certificate-container.hpp:57
ndn::security::pib::CertificateContainer::getCache
const std::unordered_map< Name, Certificate > & getCache() const
Definition:
certificate-container.hpp:144
ndn::security::pib::CertificateContainer
Container of certificates of a key.
Definition:
certificate-container.hpp:47
certificate.hpp
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:48
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::security::pib::CertificateContainer::const_iterator::value_type
const Certificate value_type
Definition:
certificate-container.hpp:54
ndn::security
Definition:
dummy-keychain.cpp:28
ndn::security::pib::detail::KeyImpl
Backend instance of Key.
Definition:
key-impl.hpp:44
ndn::security::pib::operator!=
bool operator!=(const Identity &lhs, const Identity &rhs)
Definition:
identity.cpp:101
nonstd::span_lite::size
span_constexpr std::size_t size(span< T, Extent > const &spn)
Definition:
span-lite.hpp:1535
ndn::security::pib::CertificateContainer::const_iterator::difference_type
std::ptrdiff_t difference_type
Definition:
certificate-container.hpp:55
ndn::security::pib::CertificateContainer::const_iterator::pointer
value_type * pointer
Definition:
certificate-container.hpp:56
ndnSIM
ndn-cxx
ndn-cxx
security
pib
certificate-container.hpp
Generated on Fri May 6 2022 12:34:12 for ndnSIM by
1.8.13