NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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; -*- */
22
#ifndef NDN_SIGNATURE_INFO_HPP
23
#define NDN_SIGNATURE_INFO_HPP
24
25
#include "
encoding/tlv.hpp
"
26
#include "
key-locator.hpp
"
27
#include "
security/validity-period.hpp
"
28
#include <list>
29
30
namespace
ndn
{
31
32
class
SignatureInfo
33
{
34
public
:
35
class
Error
:
public
tlv::Error
36
{
37
public
:
38
explicit
39
Error
(
const
std::string& what)
40
: tlv::
Error
(what)
41
{
42
}
43
};
44
45
SignatureInfo
();
46
47
explicit
48
SignatureInfo
(
tlv::SignatureTypeValue
type);
49
50
SignatureInfo
(
tlv::SignatureTypeValue
type,
const
KeyLocator
& keyLocator);
51
57
explicit
58
SignatureInfo
(
const
Block
& block);
59
61
void
62
setSignatureType
(
tlv::SignatureTypeValue
type);
63
65
int32_t
66
getSignatureType
()
const
67
{
68
return
m_type;
69
}
70
72
bool
73
hasKeyLocator
()
const
74
{
75
return
m_hasKeyLocator;
76
}
77
79
void
80
setKeyLocator
(
const
KeyLocator
& keyLocator);
81
83
void
84
unsetKeyLocator
();
85
91
const
KeyLocator
&
92
getKeyLocator
()
const
;
93
95
void
96
setValidityPeriod
(
const
security::ValidityPeriod
& validityPeriod);
97
99
void
100
unsetValidityPeriod
();
101
103
security::ValidityPeriod
104
getValidityPeriod
()
const
;
105
107
void
108
appendTypeSpecificTlv
(
const
Block
& block);
109
115
const
Block
&
116
getTypeSpecificTlv
(uint32_t type)
const
;
117
119
template
<encoding::Tag TAG>
120
size_t
121
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
122
124
const
Block
&
125
wireEncode
()
const
;
126
128
void
129
wireDecode
(
const
Block
& wire);
130
131
public
:
// EqualityComparable concept
132
bool
133
operator==
(
const
SignatureInfo
& rhs)
const
;
134
135
bool
136
operator!=
(
const
SignatureInfo
& rhs)
const
137
{
138
return
!(*
this
== rhs);
139
}
140
141
private
:
142
int32_t m_type;
143
bool
m_hasKeyLocator;
144
KeyLocator
m_keyLocator;
145
std::list<Block> m_otherTlvs;
146
147
mutable
Block
m_wire;
148
};
149
150
}
// namespace ndn
151
152
#endif // NDN_SIGNATURE_INFO_HPP
tlv.hpp
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::SignatureInfo::setSignatureType
void setSignatureType(tlv::SignatureTypeValue type)
Set SignatureType.
Definition:
signature-info.cpp:62
ndn::SignatureInfo::getKeyLocator
const KeyLocator & getKeyLocator() const
Get KeyLocator.
Definition:
signature-info.cpp:85
ndn::SignatureInfo
Definition:
signature-info.hpp:32
ndn::SignatureInfo::getTypeSpecificTlv
const Block & getTypeSpecificTlv(uint32_t type) const
Get signature type specific tlv block.
Definition:
signature-info.cpp:127
ndn::SignatureInfo::Error
Definition:
signature-info.hpp:35
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::SignatureInfo::wireEncode
const Block & wireEncode() const
Encode to a wire format.
Definition:
signature-info.cpp:168
ndn::SignatureInfo::unsetValidityPeriod
void unsetValidityPeriod()
Unset ValidityPeriod.
Definition:
signature-info.cpp:101
ndn::SignatureInfo::appendTypeSpecificTlv
void appendTypeSpecificTlv(const Block &block)
Append signature type specific tlv block.
Definition:
signature-info.cpp:120
ndn::SignatureInfo::setKeyLocator
void setKeyLocator(const KeyLocator &keyLocator)
Set KeyLocator.
Definition:
signature-info.cpp:69
validity-period.hpp
ndn::SignatureInfo::SignatureInfo
SignatureInfo()
Definition:
signature-info.cpp:37
ndn::security::ValidityPeriod
Abstraction of validity period.
Definition:
validity-period.hpp:37
ndn::SignatureInfo::operator==
bool operator==(const SignatureInfo &rhs) const
Definition:
signature-info.cpp:224
ndn::SignatureInfo::Error::Error
Error(const std::string &what)
Definition:
signature-info.hpp:39
ndn::SignatureInfo::hasKeyLocator
bool hasKeyLocator() const
Check if KeyLocator is set.
Definition:
signature-info.hpp:73
ndn::SignatureInfo::getSignatureType
int32_t getSignatureType() const
Get SignatureType.
Definition:
signature-info.hpp:66
ndn::SignatureInfo::operator!=
bool operator!=(const SignatureInfo &rhs) const
Definition:
signature-info.hpp:136
ndn::SignatureInfo::unsetKeyLocator
void unsetKeyLocator()
Unset KeyLocator.
Definition:
signature-info.cpp:77
ndn::SignatureInfo::setValidityPeriod
void setValidityPeriod(const security::ValidityPeriod &validityPeriod)
Set ValidityPeriod.
Definition:
signature-info.cpp:94
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:45
ndn::KeyLocator
Definition:
key-locator.hpp:30
ndn::SignatureInfo::wireDecode
void wireDecode(const Block &wire)
Decode from a wire format.
Definition:
signature-info.cpp:184
key-locator.hpp
ndn::tlv::SignatureTypeValue
SignatureTypeValue
Definition:
tlv.hpp:95
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndn::SignatureInfo::getValidityPeriod
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.
Definition:
signature-info.cpp:110
ndnSIM
ndn-cxx
src
signature-info.hpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12