NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
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 "
v1/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
v1::PublicKey
&
87
getPublicKey
()
const
;
88
95
v1::IdentityCertificate
96
getCertificate
(
const
Name
& certName)
const
;
97
99
const
CertificateContainer
&
100
getCertificates
()
const
;
101
107
const
v1::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
v1::IdentityCertificate
& certificate);
126
132
void
133
removeCertificate
(
const
Name
& certName);
134
142
const
v1::IdentityCertificate
&
143
setDefaultCertificate
(
const
Name
& certName);
144
154
const
v1::IdentityCertificate
&
155
setDefaultCertificate
(
const
v1::IdentityCertificate
& certificate);
156
157
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
168
Key
(
const
Name
& identityName,
const
name::Component
&
keyId
,
169
const
v1::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
v1::PublicKey
m_key;
194
195
mutable
bool
m_hasDefaultCertificate;
196
mutable
v1::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::v1::IdentityCertificate
Definition:
identity-certificate.hpp:34
ndn::security::Key::setDefaultCertificate
const v1::IdentityCertificate & setDefaultCertificate(const Name &certName)
Set the default certificate.
Definition:
key.cpp:151
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::Key::publicKey
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const name::Component const v1::PublicKey & publicKey
Definition:
key.hpp:168
ndn::security::Key::validityCheck
void validityCheck() const
Check the validity of this instance.
Definition:
key.cpp:193
ndn::security::Key::getKeyId
const name::Component & getKeyId() const
Get the key id of the key.
Definition:
key.cpp:87
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:47
ndn::security::Key
represents a key
Definition:
key.hpp:45
ndn::security::Key::operator!
bool operator!() const
Check if the Key instance is invalid.
Definition:
key.cpp:187
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::getIdentity
const Name & getIdentity() const
Get the name of the belonging identity.
Definition:
key.cpp:79
ndn::security::Key::getCertificates
const CertificateContainer & getCertificates() const
Get all the certificates for this key.
Definition:
key.cpp:138
ndn::security::KeyContainer
A handler to search or enumerate keys of an identity.
Definition:
key-container.hpp:34
certificate-container.hpp
ndn::security::Key::getPublicKey
const v1::PublicKey & getPublicKey() const
Get public key.
Definition:
key.cpp:95
ndn::security::Key::getName
const Name & getName() const
Get the name of the key.
Definition:
key.cpp:71
ndn::security::Key::getCertificate
v1::IdentityCertificate getCertificate(const Name &certName) const
Get a certificate.
Definition:
key.cpp:130
ndn::security::Key::impl
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const name::Component const v1::PublicKey shared_ptr< PibImpl > impl
Definition:
key.hpp:168
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::security::Key::getDefaultCertificate
const v1::IdentityCertificate & getDefaultCertificate() const
Get the default certificate for this Key.
Definition:
key.cpp:169
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::v1::PublicKey
Definition:
public-key.hpp:43
ndn::security::Key::removeCertificate
void removeCertificate(const Name &certName)
Remove a certificate.
Definition:
key.cpp:118
security
identity-certificate.hpp
ndnSIM
ndn-cxx
src
security
key.hpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13