22 #ifndef NDN_CXX_SECURITY_VALIDITY_PERIOD_HPP
23 #define NDN_CXX_SECURITY_VALIDITY_PERIOD_HPP
99 std::pair<time::system_clock::time_point, time::system_clock::time_point>
105 template<encoding::Tag TAG>
127 using TimePoint = boost::chrono::time_point<time::system_clock, time::seconds>;
136 decodeTimePoint(
const Block& element);
146 return lhs.m_notBefore == rhs.m_notBefore &&
147 lhs.m_notAfter == rhs.m_notAfter;
151 TimePoint m_notBefore;
152 TimePoint m_notAfter;
154 mutable Block m_wire;
Represents a TLV element of the NDN packet format.
Represents a ValidityPeriod TLV element.
ValidityPeriod()
Create a validity period that is invalid for any timepoint.
static ValidityPeriod makeRelative(time::seconds validFrom, time::seconds validUntil, const time::system_clock::time_point &now=time::system_clock::now())
Construct ValidityPeriod relative to a timepoint.
std::pair< time::system_clock::time_point, time::system_clock::time_point > getPeriod() const
Get the stored validity period.
bool isValid(const time::system_clock::time_point &now=time::system_clock::now()) const
Check if now falls within the validity period.
void wireDecode(const Block &wire)
Decode ValidityPeriod from TLV block.
ValidityPeriod & setPeriod(const time::system_clock::time_point ¬Before, const time::system_clock::time_point ¬After)
Set validity period [notBefore, notAfter].
friend bool operator==(const ValidityPeriod &lhs, const ValidityPeriod &rhs)
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
static time_point now() noexcept
::boost::chrono::time_point< system_clock > time_point
Represents an error in TLV encoding or decoding.
Error(const char *expectedType, uint32_t actualType)
#define NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
Contains the ndn-cxx security framework.
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
::boost::chrono::seconds seconds