28 : start_(
std::chrono::system_clock::time_point::min())
29 , end_(
std::chrono::system_clock::time_point::max())
46 TimePoint now = std::chrono::system_clock::now();
55 start_ = std::chrono::system_clock::time_point::min();
60 bzero(&tm,
sizeof(tm));
61 if (strptime(s.c_str(),
"%d/%m/%Y %H:%M", &tm))
63 start_ = std::chrono::system_clock::from_time_t(std::mktime(&tm));
68 throw std::runtime_error(
"invalid date.");
76 end_ = std::chrono::system_clock::time_point::max();
81 bzero(&tm,
sizeof(tm));
82 if (strptime(s.c_str(),
"%d/%m/%Y %H:%M", &tm))
84 end_ = std::chrono::system_clock::from_time_t(std::mktime(&tm));
89 throw std::runtime_error(
"invalid date.");
const TimePoint & end() const
bool is_valid() const
Check that the current date is between validity start and end and make sure its enabled too...
const TimePoint & start() const
bool is_enabled() const
Is the credential enabled ?
void set_start_date(const std::string &s)
Set the start validity date.
std::chrono::system_clock::time_point TimePoint
Holds classes relevant to the Authentication and Authorization subsystem.
ValidityInfo()
Default status is: enabled and no time-based limitation.
bool is_in_range() const
Are we currently is the validity range of the credential ?
void set_end_date(const std::string &s)
Set the end validity date.