summaryrefslogtreecommitdiff
path: root/src/local_time.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-02-12 21:15:03 +0100
committerCarl Hetherington <cth@carlh.net>2022-02-12 21:15:03 +0100
commitc2e0ef3ef946aca838528354d58f30611e8fc24f (patch)
treeaa4ab5bcdc5be5017f2dbf69ba3c5d693d2d4660 /src/local_time.h
parent14fe5e65786784745f52dc56bb9cd88c55f81c94 (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.h15
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;