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>
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);
Represents a TLV element of the NDN packet format.
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
Represents a Data packet.
Represents an Interest packet.
Represents a SignatureInfo or InterestSignatureInfo TLV element.
size_t wireEncode(EncodingImpl< TAG > &encoder, Type type=Type::Data) const
Fast encoding or block size estimation.
SignatureInfo & setSignatureType(tlv::SignatureTypeValue type)
Set SignatureType.
SignatureInfo & setValidityPeriod(optional< security::ValidityPeriod > validityPeriod)
Append or replace ValidityPeriod.
SignatureInfo & setNonce(optional< span< const uint8_t >> nonce)
Append or replace SignatureNonce.
optional< std::vector< uint8_t > > getNonce() const
Get SignatureNonce.
void addCustomTlv(Block block)
Append an arbitrary TLV element to this SignatureInfo.
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.
optional< uint64_t > getSeqNum() const
Get SignatureSeqNum.
int32_t getSignatureType() const noexcept
Get SignatureType.
bool hasKeyLocator() const noexcept
Check if KeyLocator is present.
bool hasWire() const noexcept
Check if this instance has cached wire encoding.
optional< Block > getCustomTlv(uint32_t type) const
Get first custom TLV element with the specified TLV-TYPE.
void removeCustomTlv(uint32_t type)
Remove all arbitrary TLV elements with the specified TLV-TYPE from this SignatureInfo.
optional< time::system_clock::time_point > getTime() const
Get SignatureTime.
void wireDecode(const Block &wire, Type type=Type::Data)
Decode from wire format.
SignatureInfo & setTime(optional< time::system_clock::time_point > time=time::system_clock::now())
Append or replace SignatureTime.
SignatureInfo & setSeqNum(optional< uint64_t > seqNum)
Append or replace SignatureSeqNum.
friend std::ostream & operator<<(std::ostream &os, const SignatureInfo &info)
friend bool operator==(const SignatureInfo &lhs, const SignatureInfo &rhs)
const KeyLocator & getKeyLocator() const
Get KeyLocator.
SignatureInfo & setKeyLocator(optional< KeyLocator > keyLocator)
Set KeyLocator.
Represents a ValidityPeriod TLV element.
static time_point now() noexcept
represents an error in TLV encoding or decoding
Error(const char *expectedType, uint32_t actualType)
EncodingImpl< EstimatorTag > EncodingEstimator
EncodingImpl< EncoderTag > EncodingBuffer
SignatureTypeValue
SignatureType values.
bool operator!=(const Data &lhs, const Data &rhs)
bool operator==(const Data &lhs, const Data &rhs)
std::ostream & operator<<(std::ostream &os, const Data &data)