| Index: net/base/x509_cert_types.h
|
| diff --git a/net/base/x509_cert_types.h b/net/base/x509_cert_types.h
|
| index f762e56d851c7b9e67139867907e8429aeb16a9b..eb3ad60629230a6ffbb257b39fad1be6e7ba0e5d 100644
|
| --- a/net/base/x509_cert_types.h
|
| +++ b/net/base/x509_cert_types.h
|
| @@ -18,6 +18,11 @@
|
| #include <Security/x509defs.h>
|
| #endif
|
|
|
| +namespace base {
|
| +class Time;
|
| +class StringPiece;
|
| +} // namespace base
|
| +
|
| namespace net {
|
|
|
| class X509Certificate;
|
| @@ -127,6 +132,23 @@ inline bool CSSMOIDEqual(const CSSM_OID* oid1, const CSSM_OID* oid2) {
|
| }
|
| #endif
|
|
|
| +// A list of ASN.1 date/time formats that ParseCertificateDate() supports,
|
| +// encoded in the canonical forms specified in RFC 2459/3280/5280.
|
| +enum CertDateFormat {
|
| + // UTCTime: Format is YYMMDDHHMMSSZ
|
| + CERT_DATE_FORMAT_UTC_TIME,
|
| +
|
| + // GeneralizedTime: Format is YYYYMMDDHHMMSSZ
|
| + CERT_DATE_FORMAT_GENERALIZED_TIME,
|
| +};
|
| +
|
| +// Attempts to parse |raw_date|, an ASN.1 date/time string encoded as
|
| +// |format|, and writes the result into |*time|. If an invalid date is
|
| +// specified, or if parsing fails, returns false, and |*time| will not be
|
| +// updated.
|
| +bool ParseCertificateDate(const base::StringPiece& raw_date,
|
| + CertDateFormat format,
|
| + base::Time* time);
|
| } // namespace net
|
|
|
| #endif // NET_BASE_X509_CERT_TYPES_H_
|
|
|