|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
28 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<SignatureInfo>));
32 static_assert(std::is_base_of<tlv::Error, SignatureInfo::Error>::value,
33 "SignatureInfo::Error must inherit from tlv::Error");
37 , m_hasKeyLocator(false)
43 , m_hasKeyLocator(false)
49 , m_hasKeyLocator(true)
50 , m_keyLocator(keyLocator)
59 template<encoding::Tag TAG>
73 size_t totalLength = 0;
75 for (
auto i = m_otherTlvs.rbegin(); i != m_otherTlvs.rend(); i++) {
76 totalLength += encoder.prependBlock(*i);
80 totalLength += m_keyLocator.
wireEncode(encoder);
83 static_cast<uint64_t
>(m_type));
84 totalLength += encoder.prependVarNumber(totalLength);
104 m_wire = buffer.block();
112 m_hasKeyLocator =
false;
127 m_type = readNonNegativeIntegerAs<tlv::SignatureTypeValue>(*it);
133 m_hasKeyLocator =
true;
139 m_otherTlvs.push_back(*it);
164 m_keyLocator = keyLocator;
165 m_hasKeyLocator =
true;
173 m_hasKeyLocator =
false;
180 NDN_THROW(
Error(
"ValidityPeriod does not exist in SignatureInfo"));
190 m_otherTlvs.push_front(validityPeriod.
wireEncode());
197 m_otherTlvs.pop_front();
205 for (
const Block& block : m_otherTlvs) {
206 if (block.type() == type)
217 m_otherTlvs.push_back(block);
223 return lhs.m_type == rhs.m_type &&
224 lhs.m_hasKeyLocator == rhs.m_hasKeyLocator &&
225 lhs.m_keyLocator == rhs.m_keyLocator &&
226 lhs.m_otherTlvs == rhs.m_otherTlvs;
233 return os <<
"Invalid SignatureInfo";
239 if (!info.m_otherTlvs.empty()) {
241 for (
const auto& block : info.m_otherTlvs) {
242 os << block.type() <<
" ";
void setSignatureType(tlv::SignatureTypeValue type)
Set SignatureType.
const Block & getTypeSpecificTlv(uint32_t type) const
Get SignatureType-specific sub-element.
void wireDecode(const Block &wire)
Decode from wire format.
element_const_iterator elements_begin() const
Equivalent to elements().begin()
SignatureInfo()
Create an invalid SignatureInfo.
void reset() noexcept
Reset the Block to a default-constructed state.
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.
a concept check for TLV abstraction with .wireDecode method and constructible from Block
EncodingImpl< EstimatorTag > EncodingEstimator
uint32_t type() const
Return the TLV-TYPE of the Block.
void wireDecode(const Block &wire)
Decode from wire encoding.
a concept check for TLV abstraction with .wireEncode method
const KeyLocator & getKeyLocator() const
Get KeyLocator.
Abstraction of validity period.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
void unsetKeyLocator()
Unset KeyLocator.
Represents a SignatureInfo TLV element.
int32_t getSignatureType() const
Get SignatureType.
SignatureTypeValue
SignatureType values.
const Block & wireEncode() const
Encode to wire format.
void parse() const
Parse TLV-VALUE into sub-elements.
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Prepend a TLV element containing a non-negative integer.
NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(Interest)
Represents a TLV element of NDN packet format.
void unsetValidityPeriod()
Unset ValidityPeriod.
std::string to_string(const T &val)
element_const_iterator elements_end() const
Equivalent to elements().end()
bool operator==(const Data &lhs, const Data &rhs)
std::ostream & operator<<(std::ostream &os, const Data &data)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Prepend wire encoding to encoder.
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
void appendTypeSpecificTlv(const Block &element)
Append SignatureType-specific sub-element.
void setValidityPeriod(const security::ValidityPeriod &validityPeriod)
Set ValidityPeriod.
bool hasKeyLocator() const
Check if KeyLocator exists.
a concept check for TLV abstraction with .wireEncode method
Copyright (c) 2011-2015 Regents of the University of California.
EncodingImpl< EncoderTag > EncodingBuffer
void setKeyLocator(const KeyLocator &keyLocator)
Set KeyLocator.