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

Side by Side 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: Fix compilation Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/time/time.h"
6 #include "net/der/encode_values.h"
7
8 namespace net {
9
10 namespace der {
11
12 bool EncodeTimeAsGeneralizedTime(const base::Time& time,
13 der::GeneralizedTime* generalized_time) {
14 base::Time::Exploded exploded;
15 time.UTCExplode(&exploded);
16 if (!exploded.HasValidValues()) {
Ryan Sleevi 2016/07/08 02:21:02 No brace ;)
dadrian 2016/07/08 22:25:42 Done.
17 return false;
18 }
19
20 generalized_time->year = exploded.year;
21 generalized_time->month = exploded.month;
22 generalized_time->day = exploded.day_of_month;
23 generalized_time->hours = exploded.hour;
24 generalized_time->minutes = exploded.minute;
25 generalized_time->seconds = exploded.second;
26 return true;
27 }
28
29 } // namespace der
30
31 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698