22 #ifndef NDN_SECURITY_VALIDITY_PERIOD_HPP 23 #define NDN_SECURITY_VALIDITY_PERIOD_HPP 88 std::pair<time::system_clock::TimePoint, time::system_clock::TimePoint>
93 template<encoding::Tag TAG>
116 typedef boost::chrono::time_point<time::system_clock, time::seconds> TimePoint;
118 TimePoint m_notBefore;
119 TimePoint m_notAfter;
121 mutable Block m_wire;
132 #endif // NDN_SECURITY_VALIDITY_PERIOD_HPP
Represents a TLV element of NDN packet format.
bool operator==(const ValidityPeriod &other) const
ValidityPeriod & setPeriod(const time::system_clock::TimePoint ¬Before, const time::system_clock::TimePoint ¬After)
Set validity period [notBefore, notAfter].
static time_point now() noexcept
#define NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
Abstraction of validity period.
std::pair< time::system_clock::TimePoint, time::system_clock::TimePoint > getPeriod() const
Get the stored validity period.
bool operator!=(const ValidityPeriod &other) const
import common constructs for ndn-cxx library internal use
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
bool isValid(const time::system_clock::TimePoint &now=time::system_clock::now()) const
Check if now falls within the validity period.
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