Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Unified Diff: net/der/encode_values.cc

Issue 2091103002: Add CheckOCSPDateValid() to net/cert/internal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from rsleevi@ Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/der/encode_values.cc
diff --git a/net/der/encode_values.cc b/net/der/encode_values.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1fe190c93cc3e9b960f570d8fadc38d6217fd34b
--- /dev/null
+++ b/net/der/encode_values.cc
@@ -0,0 +1,28 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/time/time.h"
+#include "net/der/encode_values.h"
+
+namespace net {
+
+namespace der {
+
+der::GeneralizedTime EncodeTimeAsGeneralizedTime(const base::Time& time) {
+ base::Time::Exploded exploded;
+ time.UTCExplode(&exploded);
Ryan Sleevi 2016/07/01 00:49:53 DESIGN: Check HasValidValues()? API suggestion: b
dadrian 2016/07/01 17:13:43 UTCExplode is void...what error condition are you
Ryan Sleevi 2016/07/01 17:58:07 time.UTCExplode(&exploded); if (!exploded.HasValid
dadrian 2016/07/01 18:41:11 Ah. Done. Will this fix the Windows case / thought
+
+ der::GeneralizedTime result;
+ result.year = exploded.year;
+ result.month = exploded.month;
+ result.day = exploded.day_of_month;
+ result.hours = exploded.hour;
+ result.minutes = exploded.minute;
+ result.seconds = exploded.second;
+ return result;
+}
+
+} // namespace der
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698