22 #ifndef NDN_SIGNATURE_INFO_HPP 23 #define NDN_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();
149 [[deprecated(
"use setKeyLocator(nullopt)")]]
170 [[deprecated(
"use setValidityPeriod(nullopt)")]]
177 optional<std::vector<uint8_t>>
186 setNonce(optional<std::vector<uint8_t>> nonce);
191 optional<time::system_clock::time_point>
241 [[deprecated(
"use getCustomTlv")]]
248 [[deprecated(
"use addCustomTlv")]]
253 std::vector<Block>::const_iterator
254 findOtherTlv(uint32_t type)
const;
258 optional<KeyLocator> m_keyLocator;
259 std::vector<Block> m_otherTlvs;
261 mutable Block m_wire;
270 extern template size_t 273 extern template size_t 282 return !(lhs == rhs);
290 #endif // NDN_SIGNATURE_INFO_HPP SignatureInfo & setSeqNum(optional< uint64_t > seqNum)
Append or replace SignatureSeqNum.
friend std::ostream & operator<<(std::ostream &os, const SignatureInfo &info)
const KeyLocator & getKeyLocator() const
Get KeyLocator.
Represents a SignatureInfo or InterestSignatureInfo TLV element.
optional< uint64_t > getSeqNum() const
Get SignatureSeqNum.
const Block & getTypeSpecificTlv(uint32_t type) const
Get SignatureType-specific sub-element.
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.
void unsetValidityPeriod()
Remove ValidityPeriod.
optional< time::system_clock::time_point > getTime() const
Get SignatureTime.
void appendTypeSpecificTlv(const Block &block)
Append SignatureType-specific sub-element.
friend bool operator==(const SignatureInfo &lhs, const SignatureInfo &rhs)
Abstraction of validity period.
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.
void unsetKeyLocator()
Remove KeyLocator.
SignatureTypeValue
SignatureType values.
SignatureInfo & setSignatureType(tlv::SignatureTypeValue type)
Set SignatureType.
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
SignatureInfo & setNonce(optional< std::vector< uint8_t >> nonce)
Append or replace SignatureNonce.
Error(const char *expectedType, uint32_t actualType)
represents an error in TLV encoding or decoding
EncodingImpl< EstimatorTag > EncodingEstimator
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.