NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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_HPP
23
#define NDN_SECURITY_PIB_HPP
24
25
#include "
identity-container.hpp
"
26
27
namespace
ndn
{
28
namespace
security {
29
30
class
KeyChain;
31
class
PibImpl;
32
48
class
Pib
: noncopyable
49
{
50
public
:
51
friend
class
KeyChain
;
52
53
public
:
55
class
Error
:
public
std::runtime_error
56
{
57
public
:
58
explicit
59
Error
(
const
std::string& what)
60
:
std
::runtime_error(what)
61
{
62
}
63
};
64
65
public
:
66
67
~Pib
();
68
72
std::string
73
getScheme
()
const
74
{
75
return
m_scheme
;
76
}
77
81
std::string
82
getPibLocator
()
const
;
83
92
void
93
setTpmLocator
(
const
std::string& tpmLocator);
94
98
std::string
99
getTpmLocator
()
const
;
100
107
Identity
108
getIdentity
(
const
Name
& identityName)
const
;
109
111
const
IdentityContainer
&
112
getIdentities
()
const
;
113
120
Identity
&
121
getDefaultIdentity
()
const
;
122
123
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
// write operations should be private
124
125
/*
126
* @brief Create an identity with name @p identityName and return a reference to it.
127
*
128
* If there already exists an identity for the name @p identityName, then it is returned.
129
* If no default identity is set, the newly created identity will be set as the default.
130
*
131
* @param identityName The name for the identity to be added
132
*/
133
Identity
134
addIdentity(
const
Name
& identityName);
135
136
/*
137
* @brief Remove an identity with name @p identityName.
138
*
139
* @param identityName The name for the identity to be deleted
140
*/
141
void
142
removeIdentity
(
const
Name
& identityName);
143
152
Identity
&
153
setDefaultIdentity
(
const
Name
& identityName);
154
155
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
156
/*
157
* @brief Create a new Pib with the specified @p location
158
*
159
* @param scheme The scheme for the Pib
160
* @param location The location for the Pib
161
* @param impl The backend implementation
162
*/
163
Pib
(
const
std::string scheme,
const
std::string&
location
, shared_ptr<PibImpl>
impl
);
164
165
shared_ptr<PibImpl>
166
getImpl
()
167
{
168
return
m_impl
;
169
}
170
171
protected
:
172
std::string
m_scheme
;
173
std::string
m_location
;
174
175
mutable
bool
m_hasDefaultIdentity
;
176
mutable
Identity
m_defaultIdentity
;
177
178
mutable
bool
m_needRefreshIdentities
;
179
mutable
IdentityContainer
m_identities
;
180
181
shared_ptr<PibImpl>
m_impl
;
182
};
183
184
}
// namespace security
185
}
// namespace ndn
186
187
#endif // NDN_SECURITY_PIB_HPP
ndn::security::Pib::getDefaultIdentity
Identity & getDefaultIdentity() const
Get the default identity.
Definition:
pib.cpp:108
ndn::security::Pib::m_needRefreshIdentities
bool m_needRefreshIdentities
Definition:
pib.hpp:178
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::Pib::Error::Error
Error(const std::string &what)
Definition:
pib.hpp:59
ndn::security::Identity
represents an identity
Definition:
identity.hpp:44
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::security::Pib::m_hasDefaultIdentity
bool m_hasDefaultIdentity
Definition:
pib.hpp:175
ndn::security::Pib::setTpmLocator
void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
Definition:
pib.cpp:48
ndn::security::Pib::getPibLocator
std::string getPibLocator() const
Get PIB Locator.
Definition:
pib.cpp:42
ndn::security::KeyChain
The packet signing interface.
Definition:
key-chain.hpp:48
ndn::security::Pib::m_identities
IdentityContainer m_identities
Definition:
pib.hpp:179
ndn::security::Pib::getIdentity
Identity getIdentity(const Name &identityName) const
Get an identity with name identityName.
Definition:
pib.cpp:81
std
STL namespace.
ndn::security::IdentityContainer
A handler to search or enumerate identities in PIB.
Definition:
identity-container.hpp:34
ndn::security::Pib::m_scheme
std::string m_scheme
Definition:
pib.hpp:172
ndn::security::Pib::Error
represents a semantic error
Definition:
pib.hpp:55
ndn::security::Pib::m_defaultIdentity
Identity m_defaultIdentity
Definition:
pib.hpp:176
ndn::security::Pib::removeIdentity
void removeIdentity(const Name &identityName)
Definition:
pib.cpp:71
identity-container.hpp
ndn::security::Pib::location
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string & location
Definition:
pib.hpp:163
ndn::security::Pib::getScheme
std::string getScheme() const
return the scheme of the PibLocator
Definition:
pib.hpp:73
ndn::security::Pib::setDefaultIdentity
Identity & setDefaultIdentity(const Name &identityName)
Set an identity with name identityName as the default identity.
Definition:
pib.cpp:98
ndn::security::Pib::getImpl
shared_ptr< PibImpl > getImpl()
Definition:
pib.hpp:166
ndn::security::Pib::getIdentities
const IdentityContainer & getIdentities() const
Get all the identities.
Definition:
pib.cpp:87
ndn::security::Pib::getTpmLocator
std::string getTpmLocator() const
Get TPM Locator.
Definition:
pib.cpp:54
ndn::security::Pib::m_impl
shared_ptr< PibImpl > m_impl
Definition:
pib.hpp:181
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::security::Pib
represents the PIB
Definition:
pib.hpp:48
ndn::security::Pib::impl
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string shared_ptr< PibImpl > impl
Definition:
pib.hpp:163
ndn::security::Pib::m_location
std::string m_location
Definition:
pib.hpp:173
ndn::security::Pib::~Pib
~Pib()
Definition:
pib.cpp:37
ndnSIM
ndn-cxx
src
security
pib.hpp
Generated on Sat Nov 12 2016 16:02:52 for ndnSIM by
1.8.12