NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
key.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2017 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_SECURITY_PIB_KEY_HPP
23
#define NDN_SECURITY_PIB_KEY_HPP
24
25
#include "
certificate-container.hpp
"
26
#include "../security-common.hpp"
27
28
namespace
ndn
{
29
namespace
security
{
30
31
namespace
v2 {
32
class
KeyChain
;
33
}
// namespace v2
34
35
namespace
pib {
36
37
namespace
detail {
38
class
KeyImpl;
39
}
// namespace detail
40
49
class
Key
50
{
51
public
:
70
Key
();
71
77
explicit
78
Key
(weak_ptr<detail::KeyImpl> impl);
79
83
const
Name
&
84
getName()
const
;
85
89
const
Name
&
90
getIdentity()
const
;
91
95
KeyType
96
getKeyType()
const
;
97
101
const
Buffer
&
102
getPublicKey()
const
;
103
109
v2::Certificate
110
getCertificate(
const
Name
& certName)
const
;
111
115
const
CertificateContainer
&
116
getCertificates()
const
;
117
122
const
v2::Certificate
&
123
getDefaultCertificate()
const
;
124
128
explicit
129
operator
bool()
const
;
130
131
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
// write operations should be private
139
void
140
addCertificate(
const
v2::Certificate
& certificate)
const
;
141
146
void
147
removeCertificate(
const
Name
& certName)
const
;
148
155
const
v2::Certificate
&
156
setDefaultCertificate(
const
Name
& certName)
const
;
157
163
const
v2::Certificate
&
164
setDefaultCertificate(
const
v2::Certificate
& certificate)
const
;
165
166
private
:
172
shared_ptr<detail::KeyImpl>
173
lock()
const
;
174
175
private
:
176
weak_ptr<detail::KeyImpl> m_impl;
177
178
friend
class
v2::KeyChain
;
179
friend
bool
operator!=
(
const
Key
&,
const
Key
&);
180
};
181
182
bool
183
operator!=
(
const
Key
& lhs,
const
Key
& rhs);
184
185
inline
bool
186
operator==
(
const
Key
& lhs,
const
Key
& rhs)
187
{
188
return
!(lhs != rhs);
189
}
190
191
std::ostream&
192
operator<<
(std::ostream& os,
const
Key
& key);
193
194
}
// namespace pib
195
196
using
pib::Key
;
197
198
namespace
v2 {
199
203
Name
204
constructKeyName
(
const
Name
& identity,
const
name::Component
& keyId);
205
209
bool
210
isValidKeyName
(
const
Name
& keyName);
211
215
Name
216
extractIdentityFromKeyName
(
const
Name
& keyName);
217
218
}
// namespace v2
219
220
}
// namespace security
221
}
// namespace ndn
222
223
#endif // NDN_SECURITY_PIB_KEY_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::Certificate
The certificate following the certificate format naming convention.
Definition:
certificate.hpp:81
ndn::security::v2::KeyChain
The interface of signing key management.
Definition:
key-chain.hpp:46
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::operator!=
bool operator!=(const Data &lhs, const Data &rhs)
Definition:
data.hpp:259
ndn::security::v2::isValidKeyName
bool isValidKeyName(const Name &keyName)
Check if keyName follow the naming conventions for the key name.
Definition:
key.cpp:153
websocketpp::transport::asio::socket::error::security
Catch-all error for security policy errors that don't fit in other categories.
Definition:
base.hpp:79
certificate-container.hpp
ndn::KeyType
KeyType
The type of a cryptographic key.
Definition:
security-common.hpp:85
ndn::security::pib::CertificateContainer
Container of certificates of a key.
Definition:
certificate-container.hpp:46
ndn::security::pib::Key
A frontend handle of a key instance.
Definition:
key.hpp:49
ndn::Name
Represents an absolute name.
Definition:
name.hpp:42
ndn::security::v2::operator<<
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &other)
Definition:
additional-description.cpp:178
ndn::name::Component
Component holds a read-only name component value.
Definition:
name-component.hpp:47
ndn::security::v2::constructKeyName
Name constructKeyName(const Name &identity, const name::Component &keyId)
Construct key name based on the appropriate naming conventions.
Definition:
key.cpp:143
ndn::operator==
bool operator==(const Data &lhs, const Data &rhs)
Definition:
data.cpp:265
ndn::security::v2::extractIdentityFromKeyName
Name extractIdentityFromKeyName(const Name &keyName)
Extract identity namespace from the key name keyName.
Definition:
key.cpp:160
ndn::Buffer
General-purpose automatically managed/resized buffer.
Definition:
buffer.hpp:40
ndn::security::v2::KeyChain
ndn security v2 KeyChain
Definition:
key-chain.cpp:76
ndnSIM
ndn-cxx
src
security
pib
key.hpp
Generated on Thu Nov 2 2017 03:30:28 for ndnSIM by
1.8.11