NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
identity.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_SECURITY_IDENTITY_HPP
23
#define NDN_SECURITY_IDENTITY_HPP
24
25
#include "
key-container.hpp
"
26
27
namespace
ndn
{
28
namespace
security {
29
30
class
PibImpl;
31
class
Pib;
32
class
IdentityContainer;
33
44
class
Identity
45
{
46
public
:
47
friend
class
Pib
;
48
friend
class
IdentityContainer
;
49
friend
class
KeyChain
;
50
51
public
:
70
Identity
();
71
73
const
Name
&
74
getName
()
const
;
75
82
Key
83
getKey
(
const
name::Component
&
keyId
)
const
;
84
86
const
KeyContainer
&
87
getKeys
()
const
;
88
94
Key
&
95
getDefaultKey
()
const
;
96
98
operator
bool()
const
;
99
101
bool
102
operator!
()
const
;
103
104
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
// write operations should be private
105
118
Key
119
addKey(
const
PublicKey
& publicKey,
const
name::Component
&
keyId
=
EMPTY_KEY_ID
);
120
126
void
127
removeKey
(
const
name::Component
&
keyId
);
128
136
Key
&
137
setDefaultKey
(
const
name::Component
&
keyId
);
138
149
Key
&
150
setDefaultKey
(
const
PublicKey
& publicKey,
const
name::Component
&
keyId
=
EMPTY_KEY_ID
);
151
152
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
161
Identity
(
const
Name
& identityName, shared_ptr<PibImpl>
impl
,
bool
needInit
=
false
);
162
168
void
169
validityCheck
()
const
;
170
171
public
:
177
static
const
name::Component
EMPTY_KEY_ID
;
178
179
private
:
180
Name
m_name;
181
182
mutable
bool
m_hasDefaultKey;
183
mutable
Key
m_defaultKey;
184
185
mutable
bool
m_needRefreshKeys;
186
mutable
KeyContainer
m_keys;
187
188
shared_ptr<PibImpl> m_impl;
189
};
190
191
}
// namespace security
192
}
// namespace ndn
193
194
#endif // NDN_SECURITY_IDENTITY_HPP
key-container.hpp
ndn::security::Identity::keyId
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const name::Component & keyId
Definition:
identity.hpp:119
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::Identity::getKeys
const KeyContainer & getKeys() const
Get all the keys for this Identity.
Definition:
identity.cpp:101
ndn::security::Identity::operator!
bool operator!() const
Check if the Identity instance is invalid.
Definition:
identity.cpp:151
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::KeyChain
The packet signing interface.
Definition:
key-chain.hpp:48
ndn::security::IdentityContainer
A handler to search or enumerate identities in PIB.
Definition:
identity-container.hpp:34
ndn::security::Identity::validityCheck
void validityCheck() const
Check the validity of this instance.
Definition:
identity.cpp:157
ndn::security::Key
represents a key
Definition:
key.hpp:45
ndn::security::Identity::getName
const Name & getName() const
Get the name of the identity.
Definition:
identity.cpp:53
ndn::security::Identity::setDefaultKey
Key & setDefaultKey(const name::Component &keyId)
Set the key with id keyId as the default key.
Definition:
identity.cpp:114
ndn::security::KeyContainer
A handler to search or enumerate keys of an identity.
Definition:
key-container.hpp:34
ndn::security::Identity::Identity
Identity()
Default Constructor.
Definition:
identity.cpp:31
ndn::security::Identity::impl
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE shared_ptr< PibImpl > impl
Definition:
identity.hpp:161
ndn::security::Identity::removeKey
void removeKey(const name::Component &keyId)
Remove a key.
Definition:
identity.cpp:81
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::security::Identity::EMPTY_KEY_ID
static const name::Component EMPTY_KEY_ID
The default value of keyId when add a new key.
Definition:
identity.hpp:177
ndn::name::Component
Component holds a read-only name component value.
Definition:
name-component.hpp:47
ndn::security::Pib
represents the PIB
Definition:
pib.hpp:48
ndn::security::Identity::needInit
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE shared_ptr< PibImpl > bool needInit
Definition:
identity.hpp:161
ndn::security::Identity::getKey
Key getKey(const name::Component &keyId) const
Get a key with id .
Definition:
identity.cpp:93
ndn::PublicKey
Definition:
public-key.hpp:41
ndn::security::Identity::getDefaultKey
Key & getDefaultKey() const
Get the default key for this Identity.
Definition:
identity.cpp:133
ndnSIM
ndn-cxx
src
security
identity.hpp
Generated on Tue Feb 23 2016 22:18:43 for ndnSIM by
1.8.11