22 #ifndef NDN_CXX_SECURITY_VALIDITY_PERIOD_HPP 23 #define NDN_CXX_SECURITY_VALIDITY_PERIOD_HPP 99 std::pair<time::system_clock::TimePoint, time::system_clock::TimePoint>
104 template<encoding::Tag TAG>
126 return !(lhs != rhs);
132 return lhs.m_notBefore != rhs.m_notBefore ||
133 lhs.m_notAfter != rhs.m_notAfter;
137 typedef boost::chrono::time_point<time::system_clock, time::seconds> TimePoint;
139 TimePoint m_notBefore;
140 TimePoint m_notAfter;
142 mutable Block m_wire;
153 #endif // NDN_CXX_SECURITY_VALIDITY_PERIOD_HPP
boost::chrono::seconds seconds
Copyright (c) 2011-2015 Regents of the University of California.
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
static ValidityPeriod makeRelative(time::seconds validFrom, time::seconds validUntil, const time::system_clock::TimePoint &now=time::system_clock::now())
Construct ValidityPeriod relative to a timepoint.
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(SafeBag)
Represents a TLV element of the NDN packet format.
bool isValid(const time::system_clock::TimePoint &now=time::system_clock::now()) const
Check if now falls within the validity period.
ValidityPeriod & setPeriod(const time::system_clock::TimePoint ¬Before, const time::system_clock::TimePoint ¬After)
Set validity period [notBefore, notAfter].
static time_point now() noexcept
Common includes and macros used throughout the library.
Represents a ValidityPeriod TLV element.
std::pair< time::system_clock::TimePoint, time::system_clock::TimePoint > getPeriod() const
Get the stored validity period.
friend bool operator!=(const ValidityPeriod &lhs, const ValidityPeriod &rhs)
friend bool operator==(const ValidityPeriod &lhs, const ValidityPeriod &rhs)
ValidityPeriod()
Set validity period [UNIX epoch + 1 nanosecond, UNIX epoch] that is always invalid.
void wireDecode(const Block &wire)
Decode ValidityPeriod from TLV block.
std::ostream & operator<<(std::ostream &os, const SigningInfo &si)
Error(const char *expectedType, uint32_t actualType)
represents an error in TLV encoding or decoding