NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: 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; -*- */
2
/*
3
* Copyright (c) 2013-2022 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*
21
* @author Zhiyi Zhang <dreamerbarrychang@gmail.com>
22
* @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
23
*/
24
25
#ifndef NDN_CXX_SECURITY_CERTIFICATE_HPP
26
#define NDN_CXX_SECURITY_CERTIFICATE_HPP
27
28
#include "
ndn-cxx/data.hpp
"
29
30
namespace
ndn
{
31
namespace
security
{
32
inline
namespace
v2 {
33
60
class
Certificate
:
public
Data
61
{
62
public
:
63
Certificate
();
64
69
explicit
70
Certificate
(
Data
&& data);
71
76
explicit
77
Certificate
(
const
Data
& data);
78
83
explicit
84
Certificate
(
const
Block
& block);
85
89
Name
90
getKeyName
()
const
;
91
95
Name
96
getIdentity
()
const
;
97
101
name::Component
102
getKeyId
()
const
;
103
107
name::Component
108
getIssuerId
()
const
;
109
114
Buffer
115
getPublicKey
()
const
;
116
120
ValidityPeriod
121
getValidityPeriod
()
const
;
122
126
bool
127
isValid
(
const
time::system_clock::TimePoint
& ts =
time::system_clock::now
())
const
;
128
133
Block
134
getExtension
(uint32_t type)
const
;
135
136
// @TODO Implement extension enumeration (Issue #3907)
137
public
:
141
static
bool
142
isValidName
(
const
Name
& certName);
143
144
public
:
145
static
const
ssize_t
VERSION_OFFSET
;
146
static
const
ssize_t
ISSUER_ID_OFFSET
;
147
static
const
ssize_t
KEY_COMPONENT_OFFSET
;
148
static
const
ssize_t
KEY_ID_OFFSET
;
149
static
const
size_t
MIN_CERT_NAME_LENGTH
;
150
static
const
size_t
MIN_KEY_NAME_LENGTH
;
151
static
const
name::Component
KEY_COMPONENT
;
152
static
const
name::Component
DEFAULT_ISSUER_ID
;
153
};
154
155
std::ostream&
156
operator<<
(std::ostream& os,
const
Certificate
& cert);
157
161
Name
162
extractIdentityFromCertName
(
const
Name
& certName);
163
167
Name
168
extractKeyNameFromCertName
(
const
Name
& certName);
169
170
}
// inline namespace v2
171
}
// namespace security
172
}
// namespace ndn
173
174
#endif // NDN_CXX_SECURITY_CERTIFICATE_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::Certificate::KEY_ID_OFFSET
static const ssize_t KEY_ID_OFFSET
Definition:
certificate.hpp:148
ndn::security::v2::Certificate
Represents an NDN certificate following the version 2.0 format.
Definition:
certificate.hpp:60
ndn::security::v2::Certificate::getPublicKey
Buffer getPublicKey() const
Get public key bits (in PKCS#8 format)
Definition:
certificate.cpp:104
ndn::security::v2::Certificate::getIssuerId
name::Component getIssuerId() const
Get issuer ID.
Definition:
certificate.cpp:98
ndn::security::v2::Certificate::MIN_KEY_NAME_LENGTH
static const size_t MIN_KEY_NAME_LENGTH
Definition:
certificate.hpp:150
ndn::security::v2::Certificate::getIdentity
Name getIdentity() const
Get identity name.
Definition:
certificate.cpp:86
ndn::security::v2::extractKeyNameFromCertName
Name extractKeyNameFromCertName(const Name &certName)
Extract key name from the certificate name certName.
Definition:
certificate.cpp:221
ndn::Block
Represents a TLV element of the NDN packet format.
Definition:
block.hpp:44
ndn::time::system_clock::now
static time_point now() noexcept
Definition:
time.cpp:46
ndn::security::v2::Certificate::MIN_CERT_NAME_LENGTH
static const size_t MIN_CERT_NAME_LENGTH
Definition:
certificate.hpp:149
ndn::security::v2::Certificate::Certificate
Certificate()
Definition:
certificate.cpp:47
ndn::security::v2::operator<<
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
Definition:
additional-description.cpp:167
ndn::security::ValidityPeriod
Represents a ValidityPeriod TLV element.
Definition:
validity-period.hpp:37
ndn::security::v2::Certificate::KEY_COMPONENT_OFFSET
static const ssize_t KEY_COMPONENT_OFFSET
Definition:
certificate.hpp:147
data.hpp
ndn::security::v2::Certificate::VERSION_OFFSET
static const ssize_t VERSION_OFFSET
Definition:
certificate.hpp:145
ndn::security::v2::Certificate::getKeyName
Name getKeyName() const
Get key name.
Definition:
certificate.cpp:80
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::security
Definition:
dummy-keychain.cpp:28
ndn::name::Component
Represents a name component.
Definition:
name-component.hpp:107
ndn::security::v2::Certificate::getKeyId
name::Component getKeyId() const
Get key ID.
Definition:
certificate.cpp:92
ndn::security::v2::Certificate::isValidName
static bool isValidName(const Name &certName)
Check if the specified name follows the naming convention for the certificate.
Definition:
certificate.cpp:135
ndn::security::v2::Certificate::KEY_COMPONENT
static const name::Component KEY_COMPONENT
Definition:
certificate.hpp:151
ndn::security::v2::Certificate::ISSUER_ID_OFFSET
static const ssize_t ISSUER_ID_OFFSET
Definition:
certificate.hpp:146
ndn::security::v2::Certificate::getExtension
Block getExtension(uint32_t type) const
Get extension with TLV type.
Definition:
certificate.cpp:125
ndn::security::v2::Certificate::getValidityPeriod
ValidityPeriod getValidityPeriod() const
Get validity period of the certificate.
Definition:
certificate.cpp:113
ndn::Data
Represents a Data packet.
Definition:
data.hpp:37
ndn::Buffer
General-purpose automatically managed/resized buffer.
Definition:
buffer.hpp:41
ndn::security::v2::Certificate::isValid
bool isValid(const time::system_clock::TimePoint &ts=time::system_clock::now()) const
Check if the certificate is valid at ts.
Definition:
certificate.cpp:119
ndn::time::system_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:203
ndn::security::v2::Certificate::DEFAULT_ISSUER_ID
static const name::Component DEFAULT_ISSUER_ID
Definition:
certificate.hpp:152
ndn::security::v2::extractIdentityFromCertName
Name extractIdentityFromCertName(const Name &certName)
Extract identity namespace from the certificate name certName.
Definition:
certificate.cpp:210
ndnSIM
ndn-cxx
ndn-cxx
security
certificate.hpp
Generated on Fri May 6 2022 12:34:12 for ndnSIM by
1.8.13