Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_DER_PARSE_VALUES_H_ | 5 #ifndef NET_DER_PARSE_VALUES_H_ |
| 6 #define NET_DER_PARSE_VALUES_H_ | 6 #define NET_DER_PARSE_VALUES_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/time/time.h" | |
|
Ryan Sleevi
2016/06/23 21:27:35
Forward declare
dadrian
2016/06/24 01:41:52
Done.
| |
| 11 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 12 #include "net/der/input.h" | 13 #include "net/der/input.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 namespace der { | 17 namespace der { |
| 17 | 18 |
| 18 // Reads a DER-encoded ASN.1 BOOLEAN value from |in| and puts the resulting | 19 // Reads a DER-encoded ASN.1 BOOLEAN value from |in| and puts the resulting |
| 19 // value in |out|. Returns whether the encoded value could successfully be | 20 // value in |out|. Returns whether the encoded value could successfully be |
| 20 // read. | 21 // read. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 GeneralizedTime* out) WARN_UNUSED_RESULT; | 119 GeneralizedTime* out) WARN_UNUSED_RESULT; |
| 119 | 120 |
| 120 // Reads a DER-encoded ASN.1 GeneralizedTime value from |in| and puts the | 121 // Reads a DER-encoded ASN.1 GeneralizedTime value from |in| and puts the |
| 121 // resulting value in |out|, returning true if the GeneralizedTime could | 122 // resulting value in |out|, returning true if the GeneralizedTime could |
| 122 // be parsed successfully. This function is even more restrictive than the | 123 // be parsed successfully. This function is even more restrictive than the |
| 123 // DER rules - it follows the rules from RFC5280, which does not allow for | 124 // DER rules - it follows the rules from RFC5280, which does not allow for |
| 124 // fractional seconds. | 125 // fractional seconds. |
| 125 NET_EXPORT bool ParseGeneralizedTime(const Input& in, | 126 NET_EXPORT bool ParseGeneralizedTime(const Input& in, |
| 126 GeneralizedTime* out) WARN_UNUSED_RESULT; | 127 GeneralizedTime* out) WARN_UNUSED_RESULT; |
| 127 | 128 |
| 129 // Converts a base::Time assuming the time is in UTC. | |
|
Ryan Sleevi
2016/06/23 21:27:35
Comment nit: This isn't that descriptive
// Encod
dadrian
2016/06/24 01:41:52
Done.
| |
| 130 NET_EXPORT der::GeneralizedTime ConvertBaseUTCTime(const base::Time& time); | |
| 131 | |
| 128 } // namespace der | 132 } // namespace der |
| 129 | 133 |
| 130 } // namespace net | 134 } // namespace net |
| 131 | 135 |
| 132 #endif // NET_DER_PARSE_VALUES_H_ | 136 #endif // NET_DER_PARSE_VALUES_H_ |
| OLD | NEW |