| 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 "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 12 #include "net/der/input.h" | 12 #include "net/der/input.h" |
| 13 | 13 |
| 14 namespace base { |
| 15 class Time; |
| 16 } |
| 17 |
| 14 namespace net { | 18 namespace net { |
| 15 | 19 |
| 16 namespace der { | 20 namespace der { |
| 17 | 21 |
| 18 // Reads a DER-encoded ASN.1 BOOLEAN value from |in| and puts the resulting | 22 // 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 | 23 // value in |out|. Returns whether the encoded value could successfully be |
| 20 // read. | 24 // read. |
| 21 NET_EXPORT bool ParseBool(const Input& in, bool* out) WARN_UNUSED_RESULT; | 25 NET_EXPORT bool ParseBool(const Input& in, bool* out) WARN_UNUSED_RESULT; |
| 22 | 26 |
| 23 // Like ParseBool, except it is more relaxed in what inputs it accepts: Any | 27 // Like ParseBool, except it is more relaxed in what inputs it accepts: Any |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 GeneralizedTime* out) WARN_UNUSED_RESULT; | 122 GeneralizedTime* out) WARN_UNUSED_RESULT; |
| 119 | 123 |
| 120 // Reads a DER-encoded ASN.1 GeneralizedTime value from |in| and puts the | 124 // Reads a DER-encoded ASN.1 GeneralizedTime value from |in| and puts the |
| 121 // resulting value in |out|, returning true if the GeneralizedTime could | 125 // resulting value in |out|, returning true if the GeneralizedTime could |
| 122 // be parsed successfully. This function is even more restrictive than the | 126 // 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 | 127 // DER rules - it follows the rules from RFC5280, which does not allow for |
| 124 // fractional seconds. | 128 // fractional seconds. |
| 125 NET_EXPORT bool ParseGeneralizedTime(const Input& in, | 129 NET_EXPORT bool ParseGeneralizedTime(const Input& in, |
| 126 GeneralizedTime* out) WARN_UNUSED_RESULT; | 130 GeneralizedTime* out) WARN_UNUSED_RESULT; |
| 127 | 131 |
| 132 // Encodes |time|, a UTC-based time, to DER, for comparing against other |
| 133 // GeneralizedTime objects. |
| 134 NET_EXPORT der::GeneralizedTime ConvertBaseUTCTime(const base::Time& time); |
| 135 |
| 128 } // namespace der | 136 } // namespace der |
| 129 | 137 |
| 130 } // namespace net | 138 } // namespace net |
| 131 | 139 |
| 132 #endif // NET_DER_PARSE_VALUES_H_ | 140 #endif // NET_DER_PARSE_VALUES_H_ |
| OLD | NEW |