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 /tools | |
| 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 'tools')
| -rw-r--r-- | tools/dcpkdm.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tools/dcpkdm.cc b/tools/dcpkdm.cc index 20b07ebc..d8a10fa3 100644 --- a/tools/dcpkdm.cc +++ b/tools/dcpkdm.cc @@ -55,15 +55,6 @@ help (string n) } -static string -tm_to_string (struct tm t) -{ - char buffer[64]; - snprintf (buffer, 64, "%02d/%02d/%02d %02d:%02d:%02d", t.tm_mday, t.tm_mon + 1, t.tm_year + 1900, t.tm_hour, t.tm_min, t.tm_sec); - return buffer; -} - - int main (int argc, char* argv[]) try @@ -122,8 +113,8 @@ try cout << "\t\tSubject common name: " << i.subject_common_name() << "\n"; cout << "\t\tSubject organization name: " << i.subject_organization_name() << "\n"; cout << "\t\tSubject organizational unit name: " << i.subject_organizational_unit_name() << "\n"; - cout << "\t\tNot before: " << tm_to_string(i.not_before()) << "\n"; - cout << "\t\tNot after: " << tm_to_string(i.not_after()) << "\n"; + cout << "\t\tNot before: " << i.not_before().as_string() << "\n"; + cout << "\t\tNot after: " << i.not_after().as_string() << "\n"; if (i.has_utf8_strings()) { cout << "\t\tUSES INCORRECT (UTF8) STRING ENCODING\n"; } |
