NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
pib.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_SECURITY_PIB_PIB_HPP
23
#define NDN_SECURITY_PIB_PIB_HPP
24
25
#include "
identity-container.hpp
"
26
27
namespace
ndn
{
28
namespace
security {
29
namespace
pib {
30
31
class
PibImpl;
32
52
class
Pib
: noncopyable
53
{
54
public
:
56
class
Error
:
public
std::runtime_error
57
{
58
public
:
59
explicit
60
Error
(
const
std::string& what)
61
:
std
::runtime_error(what)
62
{
63
}
64
};
65
66
public
:
67
~Pib
();
68
72
std::string
73
getScheme
()
const
74
{
75
return
m_scheme
;
76
}
77
81
std::string
82
getPibLocator
()
const
;
83
90
void
91
setTpmLocator
(
const
std::string& tpmLocator);
92
97
std::string
98
getTpmLocator
()
const
;
99
103
void
104
reset
();
105
110
Identity
111
getIdentity
(
const
Name
& identityName)
const
;
112
114
const
IdentityContainer
&
115
getIdentities
()
const
;
116
121
const
Identity
&
122
getDefaultIdentity
()
const
;
123
124
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
// write operations should be private
125
/*
126
* @brief Create a Pib instance
127
*
128
* @param scheme The scheme for the Pib
129
* @param location The location for the Pib
130
* @param impl The backend implementation
131
*/
132
Pib
(
const
std::string& scheme,
const
std::string&
location
, shared_ptr<PibImpl>
impl
);
133
134
/*
135
* @brief Create an identity with name @p identityName and return a reference to it.
136
*
137
* If there already exists an identity for the name @p identityName, then it is returned.
138
* If no default identity is set, the newly created identity will be set as the default.
139
*
140
* @param identityName The name for the identity to be added
141
*/
142
150
Identity
151
addIdentity
(
const
Name
& identity);
152
153
/*
154
* @brief Remove an @p identity.
155
*
156
* If the default identity is being removed, no default identity will be selected.
157
*/
158
void
159
removeIdentity
(
const
Name
& identity);
160
168
const
Identity
&
169
setDefaultIdentity
(
const
Name
& identity);
170
171
shared_ptr<PibImpl>
172
getImpl
()
173
{
174
return
m_impl
;
175
}
176
177
protected
:
178
std::string
m_scheme
;
179
std::string
m_location
;
180
181
mutable
bool
m_isDefaultIdentityLoaded
;
182
mutable
Identity
m_defaultIdentity
;
183
184
IdentityContainer
m_identities
;
185
186
shared_ptr<PibImpl>
m_impl
;
187
188
friend
class
v2::KeyChain
;
189
};
190
191
}
// namespace pib
192
193
using
pib::Pib
;
194
195
}
// namespace security
196
}
// namespace ndn
197
198
#endif // NDN_SECURITY_PIB_PIB_HPP
ndn::security::pib::Pib::getScheme
std::string getScheme() const
return the scheme of the PibLocator
Definition:
pib.hpp:73
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::pib::Pib::Error
represents a semantic error
Definition:
pib.hpp:56
ndn::security::v2::KeyChain
The interface of signing key management.
Definition:
key-chain.hpp:46
ndn::security::pib::Pib::m_isDefaultIdentityLoaded
bool m_isDefaultIdentityLoaded
Definition:
pib.hpp:181
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::security::pib::Pib::m_location
std::string m_location
Definition:
pib.hpp:179
ndn::security::pib::Pib::removeIdentity
void removeIdentity(const Name &identity)
Definition:
pib.cpp:88
std
STL namespace.
ndn::security::pib::Pib::impl
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string shared_ptr< PibImpl > impl
Definition:
pib.hpp:132
ndn::security::pib::Pib::reset
void reset()
Reset content in PIB, including reset of the TPM locator.
Definition:
pib.cpp:71
ndn::security::pib::Pib::~Pib
~Pib()
ndn::security::pib::Pib::getIdentities
const IdentityContainer & getIdentities() const
Get all the identities.
Definition:
pib.cpp:108
ndn::security::pib::Pib::m_impl
shared_ptr< PibImpl > m_impl
Definition:
pib.hpp:186
ndn::security::pib::Pib::setTpmLocator
void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
Definition:
pib.cpp:51
identity-container.hpp
ndn::security::pib::Pib::m_identities
IdentityContainer m_identities
Definition:
pib.hpp:184
ndn::security::pib::Pib::Error::Error
Error(const std::string &what)
Definition:
pib.hpp:60
ndn::security::pib::Pib
ndn security pib Pib
Definition:
pib.cpp:30
ndn::security::pib::Pib::getIdentity
Identity getIdentity(const Name &identityName) const
Get an identity with name identityName.
Definition:
pib.cpp:100
ndn::security::pib::Pib::setDefaultIdentity
const Identity & setDefaultIdentity(const Name &identity)
Set an identity as the default identity.
Definition:
pib.cpp:116
ndn::security::pib::Pib::getImpl
shared_ptr< PibImpl > getImpl()
Definition:
pib.hpp:172
ndn::Name
Represents an absolute name.
Definition:
name.hpp:42
ndn::security::pib::Pib::addIdentity
Identity addIdentity(const Name &identity)
Add an identity.
Definition:
pib.cpp:80
ndn::security::pib::Pib::getPibLocator
std::string getPibLocator() const
Get PIB Locator.
Definition:
pib.cpp:45
ndn::security::pib::Pib::getDefaultIdentity
const Identity & getDefaultIdentity() const
Get the default identity.
Definition:
pib.cpp:129
ndn::security::pib::IdentityContainer
Container of identities of a Pib.
Definition:
identity-container.hpp:46
ndn::security::pib::Pib::m_scheme
std::string m_scheme
Definition:
pib.hpp:178
ndn::security::pib::Identity
A frontend handle of an Identity.
Definition:
identity.hpp:42
ndn::security::pib::Pib::getTpmLocator
std::string getTpmLocator() const
Get TPM Locator.
Definition:
pib.cpp:61
ndn::security::pib::Pib::m_defaultIdentity
Identity m_defaultIdentity
Definition:
pib.hpp:182
ndn::security::pib::Pib
represents the PIB
Definition:
pib.hpp:52
ndn::security::pib::Pib::location
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string & location
Definition:
pib.hpp:132
ndnSIM
ndn-cxx
src
security
pib
pib.hpp
Generated on Tue Aug 7 2018 16:19:16 for ndnSIM by
1.8.14