NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
certificate.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NDN_SECURITY_V1_CERTIFICATE_HPP
27
#define NDN_SECURITY_V1_CERTIFICATE_HPP
28
29
#include "../../common.hpp"
30
#include "../../data.hpp"
31
#include "
certificate-subject-description.hpp
"
32
#include "
certificate-extension.hpp
"
33
#include "
public-key.hpp
"
34
35
namespace
ndn
{
36
namespace
security
{
37
namespace
v1 {
38
39
class
Certificate
:
public
Data
40
{
41
public
:
42
class
Error
:
public
Data::Error
43
{
44
public
:
45
explicit
46
Error
(
const
std::string& what)
47
:
Data
::
Error
(what)
48
{
49
}
50
};
51
52
typedef
std::vector<CertificateSubjectDescription>
SubjectDescriptionList
;
53
typedef
std::vector<CertificateExtension>
ExtensionList
;
54
58
Certificate
();
59
64
explicit
65
Certificate
(
const
Data
& data);
66
71
explicit
72
Certificate
(
const
Block
& block);
73
74
virtual
75
~Certificate
();
76
77
void
78
wireDecode
(
const
Block
& wire);
79
83
void
84
encode
();
85
90
void
91
addSubjectDescription
(
const
CertificateSubjectDescription
& description)
92
{
93
m_subjectDescriptionList
.push_back(description);
94
}
95
96
const
SubjectDescriptionList&
97
getSubjectDescriptionList
()
const
98
{
99
return
m_subjectDescriptionList
;
100
}
101
102
SubjectDescriptionList&
103
getSubjectDescriptionList
()
104
{
105
return
m_subjectDescriptionList
;
106
}
107
112
void
113
addExtension
(
const
CertificateExtension
& extension)
114
{
115
m_extensionList
.push_back(extension);
116
}
117
118
const
ExtensionList&
119
getExtensionList
()
const
120
{
121
return
m_extensionList
;
122
}
123
124
ExtensionList&
125
getExtensionList
()
126
{
127
return
m_extensionList
;
128
}
129
130
void
131
setNotBefore
(
const
time::system_clock::TimePoint
& notBefore)
132
{
133
m_notBefore
= notBefore;
134
}
135
136
time::system_clock::TimePoint
&
137
getNotBefore
()
138
{
139
return
m_notBefore
;
140
}
141
142
const
time::system_clock::TimePoint
&
143
getNotBefore
()
const
144
{
145
return
m_notBefore
;
146
}
147
148
void
149
setNotAfter
(
const
time::system_clock::TimePoint
& notAfter)
150
{
151
m_notAfter
= notAfter;
152
}
153
154
time::system_clock::TimePoint
&
155
getNotAfter
()
156
{
157
return
m_notAfter
;
158
}
159
160
const
time::system_clock::TimePoint
&
161
getNotAfter
()
const
162
{
163
return
m_notAfter
;
164
}
165
166
void
167
setPublicKeyInfo
(
const
PublicKey
& key)
168
{
169
m_key
= key;
170
}
171
172
PublicKey
&
173
getPublicKeyInfo
()
174
{
175
return
m_key
;
176
}
177
178
const
PublicKey
&
179
getPublicKeyInfo
()
const
180
{
181
return
m_key
;
182
}
183
188
bool
189
isTooEarly
();
190
195
bool
196
isTooLate
();
197
198
void
199
printCertificate
(std::ostream& os,
const
std::string& indent =
""
)
const
;
200
201
protected
:
202
void
203
decode
();
204
205
protected
:
206
SubjectDescriptionList
m_subjectDescriptionList
;
207
time::system_clock::TimePoint
m_notBefore
;
208
time::system_clock::TimePoint
m_notAfter
;
209
PublicKey
m_key
;
210
ExtensionList
m_extensionList
;
211
};
212
213
std::ostream&
214
operator<<
(std::ostream& os,
const
Certificate
& cert);
215
216
}
// namespace v1
217
}
// namespace security
218
219
#ifdef NDN_CXX_KEEP_SECURITY_V1_ALIASES
220
using
security::v1::Certificate
;
222
#endif // NDN_CXX_KEEP_SECURITY_V1_ALIASES
223
224
}
// namespace ndn
225
226
#endif // NDN_SECURITY_V1_CERTIFICATE_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v1::Certificate::m_notBefore
time::system_clock::TimePoint m_notBefore
Definition:
certificate.hpp:207
ndn::Data::Error
Definition:
data.hpp:40
ndn::security::v1::Certificate
Definition:
certificate.hpp:39
public-key.hpp
ndn::security::v1::Certificate::addExtension
void addExtension(const CertificateExtension &extension)
Add a certificate extension.
Definition:
certificate.hpp:113
ndn::security::v1::Certificate::setNotAfter
void setNotAfter(const time::system_clock::TimePoint ¬After)
Definition:
certificate.hpp:149
ndn::security::v1::operator<<
std::ostream & operator<<(std::ostream &os, const Certificate &cert)
Definition:
certificate.cpp:351
ndn::security::v1::Certificate::getPublicKeyInfo
const PublicKey & getPublicKeyInfo() const
Definition:
certificate.hpp:179
certificate-subject-description.hpp
ndn::security::v1::Certificate::Certificate
Certificate()
The default constructor.
Definition:
certificate.cpp:45
ndn::security::v1::Certificate::getSubjectDescriptionList
const SubjectDescriptionList & getSubjectDescriptionList() const
Definition:
certificate.hpp:97
ndn::security::v1::Certificate::m_subjectDescriptionList
SubjectDescriptionList m_subjectDescriptionList
Definition:
certificate.hpp:206
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::security::v1::Certificate::addSubjectDescription
void addSubjectDescription(const CertificateSubjectDescription &description)
Add a subject description.
Definition:
certificate.hpp:91
ndn::security::v1::Certificate::Error
Definition:
certificate.hpp:42
ndn::security::v1::Certificate::decode
void decode()
Definition:
certificate.cpp:197
ndn::security::v1::Certificate::~Certificate
virtual ~Certificate()
Definition:
certificate.cpp:64
ndn::security::v1::Certificate::getExtensionList
const ExtensionList & getExtensionList() const
Definition:
certificate.hpp:119
ndn::security::v1::Certificate::getPublicKeyInfo
PublicKey & getPublicKeyInfo()
Definition:
certificate.hpp:173
ndn::security::v1::Certificate::isTooEarly
bool isTooEarly()
Check if the certificate is valid.
Definition:
certificate.cpp:76
ndn::security::v1::Certificate::setNotBefore
void setNotBefore(const time::system_clock::TimePoint ¬Before)
Definition:
certificate.hpp:131
ndn::security::v1::Certificate::setPublicKeyInfo
void setPublicKeyInfo(const PublicKey &key)
Definition:
certificate.hpp:167
ndn::security::v1::Certificate::SubjectDescriptionList
std::vector< CertificateSubjectDescription > SubjectDescriptionList
Definition:
certificate.hpp:52
ndn::security::v1::Certificate::getExtensionList
ExtensionList & getExtensionList()
Definition:
certificate.hpp:125
ndn::security::v1::CertificateSubjectDescription
A CertificateSubjectDescription represents the SubjectDescription entry in a Certificate.
Definition:
certificate-subject-description.hpp:43
ndn::security::v1::Certificate::encode
void encode()
encode certificate info into content
Definition:
certificate.cpp:94
ndn::security::v1::Certificate::getSubjectDescriptionList
SubjectDescriptionList & getSubjectDescriptionList()
Definition:
certificate.hpp:103
ndn::security::v1::Certificate::getNotAfter
time::system_clock::TimePoint & getNotAfter()
Definition:
certificate.hpp:155
ndn::time::system_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:90
ndn::security::v1::Certificate::printCertificate
void printCertificate(std::ostream &os, const std::string &indent="") const
Definition:
certificate.cpp:269
ndn::security::v1::Certificate::isTooLate
bool isTooLate()
Check if the certificate is valid.
Definition:
certificate.cpp:85
ndn::security::v1::CertificateExtension
A CertificateExtension represents the Extension entry in a certificate.
Definition:
certificate-extension.hpp:44
ndn::security::v1::Certificate::Error::Error
Error(const std::string &what)
Definition:
certificate.hpp:46
ndn::security::v1::PublicKey
Definition:
public-key.hpp:43
ndn::security::v1::Certificate::m_notAfter
time::system_clock::TimePoint m_notAfter
Definition:
certificate.hpp:208
ndn::security::v1::Certificate::m_extensionList
ExtensionList m_extensionList
Definition:
certificate.hpp:210
ndn::Data
represents a Data packet
Definition:
data.hpp:37
ndn::security::v1::Certificate::wireDecode
void wireDecode(const Block &wire)
Definition:
certificate.cpp:69
ndn::security::v1::Certificate::m_key
PublicKey m_key
Definition:
certificate.hpp:209
security
certificate-extension.hpp
ndn::security::v1::Certificate::ExtensionList
std::vector< CertificateExtension > ExtensionList
Definition:
certificate.hpp:53
ndn::security::v1::Certificate::getNotAfter
const time::system_clock::TimePoint & getNotAfter() const
Definition:
certificate.hpp:161
ndn::security::v1::Certificate::getNotBefore
const time::system_clock::TimePoint & getNotBefore() const
Definition:
certificate.hpp:143
ndn::security::v1::Certificate::getNotBefore
time::system_clock::TimePoint & getNotBefore()
Definition:
certificate.hpp:137
ndnSIM
ndn-cxx
src
security
v1
certificate.hpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13