NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
signature-info.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2018 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
22
#ifndef NDN_SIGNATURE_INFO_HPP
23
#define NDN_SIGNATURE_INFO_HPP
24
25
#include "
ndn-cxx/key-locator.hpp
"
26
#include "
ndn-cxx/security/validity-period.hpp
"
27
28
#include <list>
29
30
namespace
ndn
{
31
34
class
SignatureInfo
35
{
36
public
:
37
class
Error
:
public
tlv::Error
38
{
39
public
:
40
using
tlv::Error::Error
;
41
};
42
45
SignatureInfo
();
46
49
explicit
50
SignatureInfo
(
tlv::SignatureTypeValue
type);
51
54
SignatureInfo
(
tlv::SignatureTypeValue
type,
const
KeyLocator
& keyLocator);
55
59
explicit
60
SignatureInfo
(
const
Block
& wire);
61
65
template
<encoding::Tag TAG>
66
size_t
67
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
68
71
const
Block
&
72
wireEncode
()
const
;
73
77
void
78
wireDecode
(
const
Block
& wire);
79
80
public
:
// field access
84
int32_t
85
getSignatureType
()
const
86
{
87
return
m_type;
88
}
89
92
void
93
setSignatureType
(
tlv::SignatureTypeValue
type);
94
97
bool
98
hasKeyLocator
()
const
99
{
100
return
m_hasKeyLocator;
101
}
102
106
const
KeyLocator
&
107
getKeyLocator
()
const
;
108
111
void
112
setKeyLocator
(
const
KeyLocator
& keyLocator);
113
116
void
117
unsetKeyLocator
();
118
122
security::ValidityPeriod
123
getValidityPeriod
()
const
;
124
127
void
128
setValidityPeriod
(
const
security::ValidityPeriod
& validityPeriod);
129
132
void
133
unsetValidityPeriod
();
134
139
const
Block
&
140
getTypeSpecificTlv
(uint32_t type)
const
;
141
144
void
145
appendTypeSpecificTlv
(
const
Block
& element);
146
147
private
:
148
int32_t m_type;
149
bool
m_hasKeyLocator;
150
KeyLocator
m_keyLocator;
151
std::list<Block> m_otherTlvs;
152
153
mutable
Block
m_wire;
154
155
friend
bool
156
operator==
(
const
SignatureInfo
& lhs,
const
SignatureInfo
& rhs);
157
158
friend
std::ostream&
159
operator<<
(std::ostream& os,
const
SignatureInfo
& info);
160
};
161
162
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
SignatureInfo
);
163
164
bool
165
operator==
(
const
SignatureInfo
& lhs,
const
SignatureInfo
& rhs);
166
167
inline
bool
168
operator!=
(
const
SignatureInfo
& lhs,
const
SignatureInfo
& rhs)
169
{
170
return
!(lhs == rhs);
171
}
172
173
std::ostream&
174
operator<<
(std::ostream& os,
const
SignatureInfo
& info);
175
176
}
// namespace ndn
177
178
#endif // NDN_SIGNATURE_INFO_HPP
ndn::SignatureInfo::setSignatureType
void setSignatureType(tlv::SignatureTypeValue type)
Set SignatureType.
Definition:
signature-info.cpp:145
ndn::SignatureInfo::getTypeSpecificTlv
const Block & getTypeSpecificTlv(uint32_t type) const
Get SignatureType-specific sub-element.
Definition:
signature-info.cpp:203
ndn::SignatureInfo::wireDecode
void wireDecode(const Block &wire)
Decode from wire format.
Definition:
signature-info.cpp:109
ndn::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Interest)
ndn::SignatureInfo::operator==
friend bool operator==(const SignatureInfo &lhs, const SignatureInfo &rhs)
Definition:
signature-info.cpp:221
ndn::SignatureInfo::SignatureInfo
SignatureInfo()
Create an invalid SignatureInfo.
Definition:
signature-info.cpp:35
ndn::SignatureInfo::getValidityPeriod
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.
Definition:
signature-info.cpp:177
ndn::SignatureInfo::getKeyLocator
const KeyLocator & getKeyLocator() const
Get KeyLocator.
Definition:
signature-info.cpp:152
ndn::security::ValidityPeriod
Abstraction of validity period.
Definition:
validity-period.hpp:38
ndn::SignatureInfo::unsetKeyLocator
void unsetKeyLocator()
Unset KeyLocator.
Definition:
signature-info.cpp:169
validity-period.hpp
ndn::SignatureInfo
Represents a SignatureInfo TLV element.
Definition:
signature-info.hpp:35
ndn::SignatureInfo::getSignatureType
int32_t getSignatureType() const
Get SignatureType.
Definition:
signature-info.hpp:85
ndn::tlv::SignatureTypeValue
SignatureTypeValue
SignatureType values.
Definition:
tlv.hpp:129
ndn::SignatureInfo::Error
Definition:
signature-info.hpp:38
ndn::SignatureInfo::wireEncode
const Block & wireEncode() const
Encode to wire format.
Definition:
signature-info.cpp:93
ndn::SignatureInfo::operator<<
friend std::ostream & operator<<(std::ostream &os, const SignatureInfo &info)
Definition:
signature-info.cpp:230
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:36
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:43
ndn::SignatureInfo::unsetValidityPeriod
void unsetValidityPeriod()
Unset ValidityPeriod.
Definition:
signature-info.cpp:194
ndn::operator==
bool operator==(const Data &lhs, const Data &rhs)
Definition:
data.cpp:312
ndn::operator<<
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition:
data.cpp:322
ndn::SignatureInfo::appendTypeSpecificTlv
void appendTypeSpecificTlv(const Block &element)
Append SignatureType-specific sub-element.
Definition:
signature-info.cpp:214
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:53
ndn::SignatureInfo::setValidityPeriod
void setValidityPeriod(const security::ValidityPeriod &validityPeriod)
Set ValidityPeriod.
Definition:
signature-info.cpp:187
ndn::KeyLocator
Definition:
key-locator.hpp:30
key-locator.hpp
ndn::operator!=
bool operator!=(const Data &lhs, const Data &rhs)
Definition:
data.hpp:262
ndn::tlv::Error::Error
Error(const char *expectedType, uint32_t actualType)
Definition:
tlv.cpp:27
ndn::SignatureInfo::hasKeyLocator
bool hasKeyLocator() const
Check if KeyLocator exists.
Definition:
signature-info.hpp:98
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::tlv::SignatureInfo
@ SignatureInfo
Definition:
tlv.hpp:80
ndn::SignatureInfo::setKeyLocator
void setKeyLocator(const KeyLocator &keyLocator)
Set KeyLocator.
Definition:
signature-info.cpp:161
ndnSIM
ndn-cxx
ndn-cxx
signature-info.hpp
Generated on Mon Jun 1 2020 22:32:15 for ndnSIM by
1.8.18