22 #ifndef NDN_CXX_SIGNATURE_INFO_HPP 23 #define NDN_CXX_SIGNATURE_INFO_HPP 41 enum class Type : uint32_t {
65 operator bool() const noexcept
78 template<encoding::Tag TAG>
105 return m_wire.hasWire();
129 return m_keyLocator.has_value();
163 optional<std::vector<uint8_t>>
172 setNonce(optional<span<const uint8_t>> nonce);
177 optional<time::system_clock::time_point>
223 std::vector<Block>::const_iterator
224 findOtherTlv(uint32_t type)
const;
228 optional<KeyLocator> m_keyLocator;
229 std::vector<Block> m_otherTlvs;
231 mutable Block m_wire;
241 extern template size_t 244 extern template size_t 254 return !(lhs == rhs);
262 #endif // NDN_CXX_SIGNATURE_INFO_HPP SignatureInfo & setSeqNum(optional< uint64_t > seqNum)
Append or replace SignatureSeqNum.
friend std::ostream & operator<<(std::ostream &os, const SignatureInfo &info)
Copyright (c) 2011-2015 Regents of the University of California.
const KeyLocator & getKeyLocator() const
Get KeyLocator.
Represents a SignatureInfo or InterestSignatureInfo TLV element.
optional< uint64_t > getSeqNum() const
Get SignatureSeqNum.
SignatureInfo & setValidityPeriod(optional< security::ValidityPeriod > validityPeriod)
Append or replace ValidityPeriod.
bool hasWire() const noexcept
Check if this instance has cached wire encoding.
int32_t getSignatureType() const noexcept
Get SignatureType.
Represents a TLV element of the NDN packet format.
Represents an Interest packet.
static time_point now() noexcept
bool operator!=(const Data &lhs, const Data &rhs)
optional< Block > getCustomTlv(uint32_t type) const
Get first custom TLV element with the specified TLV-TYPE.
optional< time::system_clock::time_point > getTime() const
Get SignatureTime.
friend bool operator==(const SignatureInfo &lhs, const SignatureInfo &rhs)
Represents a ValidityPeriod TLV element.
bool hasKeyLocator() const noexcept
Check if KeyLocator is present.
optional< std::vector< uint8_t > > getNonce() const
Get SignatureNonce.
SignatureInfo & setTime(optional< time::system_clock::time_point > time=time::system_clock::now())
Append or replace SignatureTime.
SignatureTypeValue
SignatureType values.
SignatureInfo & setSignatureType(tlv::SignatureTypeValue type)
Set SignatureType.
SignatureInfo & setNonce(optional< span< const uint8_t >> nonce)
Append or replace SignatureNonce.
size_t wireEncode(EncodingImpl< TAG > &encoder, Type type=Type::Data) const
Fast encoding or block size estimation.
void removeCustomTlv(uint32_t type)
Remove all arbitrary TLV elements with the specified TLV-TYPE from this SignatureInfo.
SignatureInfo & setKeyLocator(optional< KeyLocator > keyLocator)
Set KeyLocator.
void addCustomTlv(Block block)
Append an arbitrary TLV element to this SignatureInfo.
Represents a Data packet.
void wireDecode(const Block &wire, Type type=Type::Data)
Decode from wire format.
EncodingImpl< EncoderTag > EncodingBuffer
const nullopt_t nullopt((nullopt_t::init()))
Error(const char *expectedType, uint32_t actualType)
represents an error in TLV encoding or decoding
EncodingImpl< EstimatorTag > EncodingEstimator
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.