22 #ifndef NDN_SECURITY_VALIDITY_PERIOD_HPP 23 #define NDN_SECURITY_VALIDITY_PERIOD_HPP 25 #include "../common.hpp" 26 #include "../encoding/tlv.hpp" 27 #include "../encoding/block.hpp" 28 #include "../util/time.hpp" 92 std::pair<time::system_clock::TimePoint, time::system_clock::TimePoint>
97 template<encoding::Tag TAG>
120 typedef boost::chrono::time_point<time::system_clock, time::seconds> TimePoint;
122 TimePoint m_notBefore;
123 TimePoint m_notAfter;
125 mutable Block m_wire;
136 #endif // NDN_SECURITY_VALIDITY_PERIOD_HPP Copyright (c) 2013-2017 Regents of the University of California.
Error(const std::string &what)
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
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)
represents an error in TLV encoding or decoding