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
key.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_SECURITY_KEY_HPP
23
#define NDN_SECURITY_KEY_HPP
24
25
#include "
identity-certificate.hpp
"
26
#include "
certificate-container.hpp
"
27
28
namespace
ndn
{
29
namespace
security {
30
31
class
PibImpl;
32
class
Identity;
33
class
KeyContainer;
34
45
class
Key
46
{
47
public
:
48
friend
class
Identity
;
49
friend
class
KeyContainer
;
50
friend
class
KeyChain
;
51
52
public
:
71
Key
();
72
74
const
Name
&
75
getName
()
const
;
76
78
const
Name
&
79
getIdentity
()
const
;
80
82
const
name::Component
&
83
getKeyId
()
const
;
84
86
const
PublicKey
&
87
getPublicKey
()
const
;
88
95
IdentityCertificate
96
getCertificate
(
const
Name
& certName)
const
;
97
99
const
CertificateContainer
&
100
getCertificates
()
const
;
101
107
const
IdentityCertificate
&
108
getDefaultCertificate
()
const
;
109
111
operator
bool()
const
;
112
114
bool
115
operator!
()
const
;
116
117
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
// write operations should be private
118
124
void
125
addCertificate(
const
IdentityCertificate
& certificate);
126
132
void
133
removeCertificate
(
const
Name
& certName);
134
142
const
IdentityCertificate
&
143
setDefaultCertificate
(
const
Name
& certName);
144
154
const
IdentityCertificate
&
155
setDefaultCertificate
(
const
IdentityCertificate
& certificate);
156
157
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
168
Key
(
const
Name
& identityName,
const
name::Component
&
keyId
,
169
const
PublicKey
&
publicKey
, shared_ptr<PibImpl>
impl
);
170
179
Key
(
const
Name
& identityName,
const
name::Component
&
keyId
, shared_ptr<PibImpl>
impl
);
180
186
void
187
validityCheck
()
const
;
188
189
private
:
190
Name
m_id;
191
name::Component
m_keyId;
192
Name
m_keyName;
193
PublicKey
m_key;
194
195
mutable
bool
m_hasDefaultCertificate;
196
mutable
IdentityCertificate
m_defaultCertificate;
197
198
mutable
bool
m_needRefreshCerts;
199
mutable
CertificateContainer
m_certificates;
200
201
shared_ptr<PibImpl> m_impl;
202
};
203
204
}
// namespace security
205
}
// namespace ndn
206
207
#endif // NDN_SECURITY_PIB_HPP
ndn::security::Key::validityCheck
void validityCheck() const
Check the validity of this instance.
Definition:
key.cpp:194
ndn::security::Key::getIdentity
const Name & getIdentity() const
Get the name of the belonging identity.
Definition:
key.cpp:79
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::Key::getCertificate
IdentityCertificate getCertificate(const Name &certName) const
Get a certificate.
Definition:
key.cpp:130
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::Key::getDefaultCertificate
const IdentityCertificate & getDefaultCertificate() const
Get the default certificate for this Key.
Definition:
key.cpp:170
ndn::security::KeyChain
The packet signing interface.
Definition:
key-chain.hpp:48
ndn::security::Key
represents a key
Definition:
key.hpp:45
ndn::security::CertificateContainer
A handler to search or enumerate certificates of a key.
Definition:
certificate-container.hpp:34
ndn::security::Key::Key
Key()
Default Constructor.
Definition:
key.cpp:29
ndn::security::Key::getName
const Name & getName() const
Get the name of the key.
Definition:
key.cpp:71
ndn::security::KeyContainer
A handler to search or enumerate keys of an identity.
Definition:
key-container.hpp:34
certificate-container.hpp
ndn::security::Key::impl
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const name::Component const PublicKey shared_ptr< PibImpl > impl
Definition:
key.hpp:168
ndn::security::Key::operator!
bool operator!() const
Check if the Key instance is invalid.
Definition:
key.cpp:188
ndn::security::Key::getCertificates
const CertificateContainer & getCertificates() const
Get all the certificates for this key.
Definition:
key.cpp:138
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
identity-certificate.hpp
ndn::security::Key::setDefaultCertificate
const IdentityCertificate & setDefaultCertificate(const Name &certName)
Set the default certificate.
Definition:
key.cpp:152
ndn::security::Key::publicKey
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const name::Component const PublicKey & publicKey
Definition:
key.hpp:168
ndn::name::Component
Component holds a read-only name component value.
Definition:
name-component.hpp:47
ndn::security::Key::keyId
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const name::Component & keyId
Definition:
key.hpp:168
ndn::security::Key::getKeyId
const name::Component & getKeyId() const
Get the key id of the key.
Definition:
key.cpp:87
ndn::security::Key::removeCertificate
void removeCertificate(const Name &certName)
Remove a certificate.
Definition:
key.cpp:118
ndn::PublicKey
Definition:
public-key.hpp:41
ndn::IdentityCertificate
Definition:
identity-certificate.hpp:32
ndn::security::Key::getPublicKey
const PublicKey & getPublicKey() const
Get public key.
Definition:
key.cpp:95
ndnSIM
ndn-cxx
src
security
key.hpp
Generated on Tue Feb 23 2016 22:18:43 for ndnSIM by
1.8.11