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
certificate.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NDN_SECURITY_CERTIFICATE_HPP
27
#define NDN_SECURITY_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
37
class
Certificate
:
public
Data
38
{
39
public
:
40
class
Error
:
public
Data::Error
41
{
42
public
:
43
explicit
44
Error
(
const
std::string& what)
45
:
Data
::
Error
(what)
46
{
47
}
48
};
49
50
typedef
std::vector<CertificateSubjectDescription>
SubjectDescriptionList
;
51
typedef
std::vector<CertificateExtension>
ExtensionList
;
52
56
Certificate
();
57
62
explicit
63
Certificate
(
const
Data
& data);
64
69
explicit
70
Certificate
(
const
Block
& block);
71
72
virtual
73
~Certificate
();
74
75
void
76
wireDecode
(
const
Block
& wire);
77
81
void
82
encode
();
83
88
void
89
addSubjectDescription
(
const
CertificateSubjectDescription
& description)
90
{
91
m_subjectDescriptionList
.push_back(description);
92
}
93
94
const
SubjectDescriptionList&
95
getSubjectDescriptionList
()
const
96
{
97
return
m_subjectDescriptionList
;
98
}
99
100
SubjectDescriptionList&
101
getSubjectDescriptionList
()
102
{
103
return
m_subjectDescriptionList
;
104
}
105
110
void
111
addExtension
(
const
CertificateExtension
& extension)
112
{
113
m_extensionList
.push_back(extension);
114
}
115
116
const
ExtensionList&
117
getExtensionList
()
const
118
{
119
return
m_extensionList
;
120
}
121
122
ExtensionList&
123
getExtensionList
()
124
{
125
return
m_extensionList
;
126
}
127
128
void
129
setNotBefore
(
const
time::system_clock::TimePoint
& notBefore)
130
{
131
m_notBefore
= notBefore;
132
}
133
134
time::system_clock::TimePoint
&
135
getNotBefore
()
136
{
137
return
m_notBefore
;
138
}
139
140
const
time::system_clock::TimePoint
&
141
getNotBefore
()
const
142
{
143
return
m_notBefore
;
144
}
145
146
void
147
setNotAfter
(
const
time::system_clock::TimePoint
& notAfter)
148
{
149
m_notAfter
= notAfter;
150
}
151
152
time::system_clock::TimePoint
&
153
getNotAfter
()
154
{
155
return
m_notAfter
;
156
}
157
158
const
time::system_clock::TimePoint
&
159
getNotAfter
()
const
160
{
161
return
m_notAfter
;
162
}
163
164
void
165
setPublicKeyInfo
(
const
PublicKey
& key)
166
{
167
m_key
= key;
168
}
169
170
PublicKey
&
171
getPublicKeyInfo
()
172
{
173
return
m_key
;
174
}
175
176
const
PublicKey
&
177
getPublicKeyInfo
()
const
178
{
179
return
m_key
;
180
}
181
186
bool
187
isTooEarly
();
188
193
bool
194
isTooLate
();
195
196
void
197
printCertificate
(std::ostream& os,
const
std::string& indent =
""
)
const
;
198
199
protected
:
200
void
201
decode
();
202
203
protected
:
204
SubjectDescriptionList
m_subjectDescriptionList
;
205
time::system_clock::TimePoint
m_notBefore
;
206
time::system_clock::TimePoint
m_notAfter
;
207
PublicKey
m_key
;
208
ExtensionList
m_extensionList
;
209
};
210
211
std::ostream&
212
operator<<
(std::ostream& os,
const
Certificate
& cert);
213
}
// namespace ndn
214
215
#endif // NDN_SECURITY_CERTIFICATE_HPP
ndn::Certificate::getNotBefore
time::system_clock::TimePoint & getNotBefore()
Definition:
certificate.hpp:135
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::Certificate::Error::Error
Error(const std::string &what)
Definition:
certificate.hpp:44
ndn::Certificate::m_extensionList
ExtensionList m_extensionList
Definition:
certificate.hpp:208
ndn::Certificate::getNotAfter
time::system_clock::TimePoint & getNotAfter()
Definition:
certificate.hpp:153
ndn::Certificate::addSubjectDescription
void addSubjectDescription(const CertificateSubjectDescription &description)
Add a subject description.
Definition:
certificate.hpp:89
ndn::Data::Error
Definition:
data.hpp:42
ndn::Certificate::addExtension
void addExtension(const CertificateExtension &extension)
Add a certificate extension.
Definition:
certificate.hpp:111
ndn::Certificate::ExtensionList
std::vector< CertificateExtension > ExtensionList
Definition:
certificate.hpp:51
ndn::CertificateSubjectDescription
A CertificateSubjectDescription represents the SubjectDescription entry in a Certificate.
Definition:
certificate-subject-description.hpp:41
ndn::Certificate::getSubjectDescriptionList
const SubjectDescriptionList & getSubjectDescriptionList() const
Definition:
certificate.hpp:95
ndn::operator<<
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition:
data.cpp:340
certificate-subject-description.hpp
ndn::Certificate::wireDecode
void wireDecode(const Block &wire)
Definition:
certificate.cpp:69
ndn::Certificate::m_key
PublicKey m_key
Definition:
certificate.hpp:207
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::Certificate::Certificate
Certificate()
The default constructor.
Definition:
certificate.cpp:45
ndn::Certificate::getNotAfter
const time::system_clock::TimePoint & getNotAfter() const
Definition:
certificate.hpp:159
public-key.hpp
ndn::Certificate::getPublicKeyInfo
PublicKey & getPublicKeyInfo()
Definition:
certificate.hpp:171
ndn::Certificate::getExtensionList
const ExtensionList & getExtensionList() const
Definition:
certificate.hpp:117
ndn::Certificate::m_notAfter
time::system_clock::TimePoint m_notAfter
Definition:
certificate.hpp:206
ndn::Certificate
Definition:
certificate.hpp:37
ndn::Certificate::setNotBefore
void setNotBefore(const time::system_clock::TimePoint ¬Before)
Definition:
certificate.hpp:129
ndn::Certificate::isTooLate
bool isTooLate()
Check if the certificate is valid.
Definition:
certificate.cpp:85
ndn::Certificate::encode
void encode()
encode certificate info into content
Definition:
certificate.cpp:94
ndn::Certificate::getPublicKeyInfo
const PublicKey & getPublicKeyInfo() const
Definition:
certificate.hpp:177
ndn::Certificate::m_notBefore
time::system_clock::TimePoint m_notBefore
Definition:
certificate.hpp:205
ndn::Certificate::isTooEarly
bool isTooEarly()
Check if the certificate is valid.
Definition:
certificate.cpp:76
ndn::Certificate::Error
Definition:
certificate.hpp:40
ndn::time::system_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:78
ndn::Certificate::m_subjectDescriptionList
SubjectDescriptionList m_subjectDescriptionList
Definition:
certificate.hpp:204
ndn::Certificate::getSubjectDescriptionList
SubjectDescriptionList & getSubjectDescriptionList()
Definition:
certificate.hpp:101
ndn::Certificate::SubjectDescriptionList
std::vector< CertificateSubjectDescription > SubjectDescriptionList
Definition:
certificate.hpp:50
ndn::Certificate::~Certificate
virtual ~Certificate()
Definition:
certificate.cpp:64
ndn::Certificate::printCertificate
void printCertificate(std::ostream &os, const std::string &indent="") const
Definition:
certificate.cpp:269
ndn::Certificate::getExtensionList
ExtensionList & getExtensionList()
Definition:
certificate.hpp:123
ndn::Certificate::getNotBefore
const time::system_clock::TimePoint & getNotBefore() const
Definition:
certificate.hpp:141
ndn::CertificateExtension
A CertificateExtension represents the Extension entry in a certificate.
Definition:
certificate-extension.hpp:42
ndn::PublicKey
Definition:
public-key.hpp:41
ndn::Certificate::decode
void decode()
Definition:
certificate.cpp:197
ndn::Data
represents a Data packet
Definition:
data.hpp:39
certificate-extension.hpp
ndn::Certificate::setNotAfter
void setNotAfter(const time::system_clock::TimePoint ¬After)
Definition:
certificate.hpp:147
ndn::Certificate::setPublicKeyInfo
void setPublicKeyInfo(const PublicKey &key)
Definition:
certificate.hpp:165
ndnSIM
ndn-cxx
src
security
certificate.hpp
Generated on Tue Feb 23 2016 22:18:43 for ndnSIM by
1.8.11