NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
key-impl.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_SECURITY_PIB_DETAIL_KEY_IMPL_HPP
23
#define NDN_SECURITY_PIB_DETAIL_KEY_IMPL_HPP
24
25
#include "../../security-common.hpp"
26
#include "../certificate-container.hpp"
27
28
namespace
ndn
{
29
namespace
security {
30
namespace
pib {
31
32
class
PibImpl;
33
34
namespace
detail {
35
44
class
KeyImpl
: noncopyable
45
{
46
public
:
59
KeyImpl
(
const
Name
& keyName,
const
uint8_t* key,
size_t
keyLen, shared_ptr<PibImpl> pibImpl);
60
68
KeyImpl
(
const
Name
& keyName, shared_ptr<PibImpl> pibImpl);
69
73
const
Name
&
74
getName
()
const
75
{
76
return
m_keyName;
77
}
78
82
const
Name
&
83
getIdentity
()
const
84
{
85
return
m_identity;
86
}
87
91
KeyType
92
getKeyType
()
const
93
{
94
return
m_keyType;
95
}
96
100
const
Buffer
&
101
getPublicKey
()
const
102
{
103
return
m_key;
104
}
105
117
void
118
addCertificate
(
const
v2::Certificate
& certificate);
119
124
void
125
removeCertificate
(
const
Name
& certName);
126
132
v2::Certificate
133
getCertificate
(
const
Name
& certName)
const
;
134
138
const
CertificateContainer
&
139
getCertificates
()
const
;
140
147
const
v2::Certificate
&
148
setDefaultCertificate
(
const
Name
& certName);
149
159
const
v2::Certificate
&
160
setDefaultCertificate
(
const
v2::Certificate
& certificate);
161
166
const
v2::Certificate
&
167
getDefaultCertificate
()
const
;
168
169
private
:
170
Name
m_identity;
171
Name
m_keyName;
172
Buffer
m_key;
173
KeyType
m_keyType;
174
175
shared_ptr<PibImpl> m_pib;
176
177
CertificateContainer
m_certificates;
178
mutable
bool
m_isDefaultCertificateLoaded;
179
mutable
v2::Certificate
m_defaultCertificate;
180
};
181
182
}
// namespace detail
183
}
// namespace pib
184
}
// namespace security
185
}
// namespace ndn
186
187
#endif // NDN_SECURITY_PIB_DETAIL_KEY_IMPL_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::Certificate
The certificate following the certificate format naming convention.
Definition:
certificate.hpp:81
ndn::security::pib::detail::KeyImpl::getPublicKey
const Buffer & getPublicKey() const
Get public key bits.
Definition:
key-impl.hpp:101
ndn::security::pib::detail::KeyImpl::getDefaultCertificate
const v2::Certificate & getDefaultCertificate() const
Get the default certificate for this key.
Definition:
key-impl.cpp:121
ndn::security::pib::detail::KeyImpl::setDefaultCertificate
const v2::Certificate & setDefaultCertificate(const Name &certName)
Set an existing certificate with name certName as the default certificate.
Definition:
key-impl.cpp:103
ndn::KeyType
KeyType
The type of a cryptographic key.
Definition:
security-common.hpp:85
ndn::security::pib::CertificateContainer
Container of certificates of a key.
Definition:
certificate-container.hpp:46
ndn::security::pib::detail::KeyImpl::getName
const Name & getName() const
Get the name of the key.
Definition:
key-impl.hpp:74
ndn::security::pib::detail::KeyImpl::getKeyType
KeyType getKeyType() const
Get key type.
Definition:
key-impl.hpp:92
ndn::Name
Represents an absolute name.
Definition:
name.hpp:42
ndn::security::pib::detail::KeyImpl::removeCertificate
void removeCertificate(const Name &certName)
Remove a certificate with certName.
Definition:
key-impl.cpp:78
ndn::security::pib::detail::KeyImpl::getIdentity
const Name & getIdentity() const
Get the name of the belonging identity.
Definition:
key-impl.hpp:83
ndn::security::pib::detail::KeyImpl
Backend instance of Key.
Definition:
key-impl.hpp:44
ndn::security::pib::detail::KeyImpl::addCertificate
void addCertificate(const v2::Certificate &certificate)
Add certificate.
Definition:
key-impl.cpp:71
ndn::Buffer
General-purpose automatically managed/resized buffer.
Definition:
buffer.hpp:40
ndn::security::pib::detail::KeyImpl::KeyImpl
KeyImpl(const Name &keyName, const uint8_t *key, size_t keyLen, shared_ptr< PibImpl > pibImpl)
Create a KeyImpl with keyName.
Definition:
key-impl.cpp:32
ndn::security::pib::detail::KeyImpl::getCertificates
const CertificateContainer & getCertificates() const
Get all the certificates for this key.
Definition:
key-impl.cpp:96
ndn::security::pib::detail::KeyImpl::getCertificate
v2::Certificate getCertificate(const Name &certName) const
Get a certificate with certName.
Definition:
key-impl.cpp:89
ndnSIM
ndn-cxx
src
security
pib
detail
key-impl.hpp
Generated on Sun Feb 25 2018 13:27:05 for ndnSIM by
1.8.14