diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-02-12 21:15:03 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-02-12 23:13:49 +0100 |
| commit | d6b800e1c9a3cdb4f85a2308190afe9f0a856ed4 (patch) | |
| tree | 439b3c142ac392b9888585d51c463696cef6ff87 /src/local_time.h | |
| parent | 0a5615c17edf6d9c51d9269c824d6caf71f710e5 (diff) | |
Cleanup: use dcp::LocalTime for certificate validity times.
Before we were using struct tm but not filling it all in, which
seems quite unpleasant.
Diffstat (limited to 'src/local_time.h')
| -rw-r--r-- | src/local_time.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/local_time.h b/src/local_time.h index a5a479cd..b84e3098 100644 --- a/src/local_time.h +++ b/src/local_time.h @@ -103,6 +103,18 @@ public: return _year; } + int hour () const { + return _hour; + } + + int minute () const { + return _minute; + } + + int second () const { + return _second; + } + void set_year (int y) { _year = y; } @@ -111,6 +123,9 @@ public: void add_months (int a); void add_minutes (int a); + static LocalTime from_asn1_utc_time (std::string time); + static LocalTime from_asn1_generalized_time (std::string time); + bool operator== (LocalTime const & other) const; bool operator!= (LocalTime const & other) const; bool operator< (LocalTime const & other) const; |
