| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_X509_CERT_TYPES_H_ | 5 #ifndef NET_BASE_X509_CERT_TYPES_H_ |
| 6 #define NET_BASE_X509_CERT_TYPES_H_ | 6 #define NET_BASE_X509_CERT_TYPES_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/string_piece.h" |
| 15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 16 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
| 17 | 18 |
| 18 #if defined(OS_MACOSX) | 19 #if defined(OS_MACOSX) |
| 19 #include <Security/x509defs.h> | 20 #include <Security/x509defs.h> |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class Time; | 24 class Time; |
| 24 class StringPiece; | |
| 25 } // namespace base | 25 } // namespace base |
| 26 | 26 |
| 27 namespace net { | 27 namespace net { |
| 28 | 28 |
| 29 class X509Certificate; | 29 class X509Certificate; |
| 30 | 30 |
| 31 // SHA-1 fingerprint (160 bits) of a certificate. | 31 // SHA-1 fingerprint (160 bits) of a certificate. |
| 32 struct SHA1Fingerprint { | 32 struct SHA1Fingerprint { |
| 33 bool Equals(const SHA1Fingerprint& other) const { | 33 bool Equals(const SHA1Fingerprint& other) const { |
| 34 return memcmp(data, other.data, sizeof(data)) == 0; | 34 return memcmp(data, other.data, sizeof(data)) == 0; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as | 146 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as |
| 147 // |format|, and writes the result into |*time|. If an invalid date is | 147 // |format|, and writes the result into |*time|. If an invalid date is |
| 148 // specified, or if parsing fails, returns false, and |*time| will not be | 148 // specified, or if parsing fails, returns false, and |*time| will not be |
| 149 // updated. | 149 // updated. |
| 150 bool ParseCertificateDate(const base::StringPiece& raw_date, | 150 bool ParseCertificateDate(const base::StringPiece& raw_date, |
| 151 CertDateFormat format, | 151 CertDateFormat format, |
| 152 base::Time* time); | 152 base::Time* time); |
| 153 } // namespace net | 153 } // namespace net |
| 154 | 154 |
| 155 #endif // NET_BASE_X509_CERT_TYPES_H_ | 155 #endif // NET_BASE_X509_CERT_TYPES_H_ |
| OLD | NEW |