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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
10 #include "net/der/input.h" | 10 #include "net/der/input.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 // Like ParseUTCTime, but it is more lenient in what is accepted. DER requires | 105 // Like ParseUTCTime, but it is more lenient in what is accepted. DER requires |
106 // a UTCTime to be in the format YYMMDDhhmmssZ; this function will accept both | 106 // a UTCTime to be in the format YYMMDDhhmmssZ; this function will accept both |
107 // that and YYMMDDhhmmZ, which is a valid BER encoding of a UTCTime which | 107 // that and YYMMDDhhmmZ, which is a valid BER encoding of a UTCTime which |
108 // sometimes incorrectly appears in X.509 certificates. | 108 // sometimes incorrectly appears in X.509 certificates. |
109 NET_EXPORT bool ParseUTCTimeRelaxed(const Input& in, | 109 NET_EXPORT bool ParseUTCTimeRelaxed(const Input& in, |
110 GeneralizedTime* out) WARN_UNUSED_RESULT; | 110 GeneralizedTime* out) WARN_UNUSED_RESULT; |
111 | 111 |
112 // Reads a DER-encoded ASN.1 GeneralizedTime value from |in| and puts the | 112 // Reads a DER-encoded ASN.1 GeneralizedTime value from |in| and puts the |
113 // resulting value in |out|, returning true if the GeneralizedTime could | 113 // resulting value in |out|, returning true if the GeneralizedTime could |
114 // be parsed sucessfully. This function is even more restrictive than the | 114 // be parsed successfully. This function is even more restrictive than the |
115 // DER rules - it follows the rules from RFC5280, which does not allow for | 115 // DER rules - it follows the rules from RFC5280, which does not allow for |
116 // fractional seconds. | 116 // fractional seconds. |
117 NET_EXPORT bool ParseGeneralizedTime(const Input& in, | 117 NET_EXPORT bool ParseGeneralizedTime(const Input& in, |
118 GeneralizedTime* out) WARN_UNUSED_RESULT; | 118 GeneralizedTime* out) WARN_UNUSED_RESULT; |
119 | 119 |
120 } // namespace der | 120 } // namespace der |
121 | 121 |
122 } // namespace net | 122 } // namespace net |
123 | 123 |
124 #endif // NET_DER_PARSE_VALUES_H_ | 124 #endif // NET_DER_PARSE_VALUES_H_ |
OLD | NEW |