Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 struct NET_EXPORT CertPrincipal { | 114 struct NET_EXPORT CertPrincipal { |
| 115 CertPrincipal(); | 115 CertPrincipal(); |
| 116 explicit CertPrincipal(const std::string& name); | 116 explicit CertPrincipal(const std::string& name); |
| 117 ~CertPrincipal(); | 117 ~CertPrincipal(); |
| 118 | 118 |
| 119 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) | 119 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) |
| 120 // Parses a BER-format DistinguishedName. | 120 // Parses a BER-format DistinguishedName. |
| 121 bool ParseDistinguishedName(const void* ber_name_data, size_t length); | 121 bool ParseDistinguishedName(const void* ber_name_data, size_t length); |
| 122 #endif | 122 #endif |
| 123 | 123 |
| 124 #if defined(OS_MACOSX) | 124 #if defined(OS_MACOSX) || defined(USE_OPENSSL) |
|
Ryan Sleevi
2012/12/11 21:30:24
NACK on this. CertPrincipal::Compare() should NOT
digit1
2012/12/11 23:05:31
Oh point, taken. Actually, that's a left-over, the
| |
| 125 // Compare this CertPrincipal with |against|, returning true if they're | 125 // Compare this CertPrincipal with |against|, returning true if they're |
| 126 // equal enough to be a possible match. This should NOT be used for any | 126 // equal enough to be a possible match. This should NOT be used for any |
| 127 // security relevant decisions. | 127 // security relevant decisions. |
| 128 // TODO(rsleevi): Remove once Mac client auth uses NSS for name comparison. | 128 // TODO(rsleevi): Remove once Mac client auth uses NSS for name comparison. |
| 129 bool Matches(const CertPrincipal& against) const; | 129 bool Matches(const CertPrincipal& against) const; |
| 130 #endif | 130 #endif |
| 131 | 131 |
| 132 // Returns a name that can be used to represent the issuer. It tries in this | 132 // Returns a name that can be used to represent the issuer. It tries in this |
| 133 // order: CN, O and OU and returns the first non-empty one found. | 133 // order: CN, O and OU and returns the first non-empty one found. |
| 134 std::string GetDisplayName() const; | 134 std::string GetDisplayName() const; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as | 210 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as |
| 211 // |format|, and writes the result into |*time|. If an invalid date is | 211 // |format|, and writes the result into |*time|. If an invalid date is |
| 212 // specified, or if parsing fails, returns false, and |*time| will not be | 212 // specified, or if parsing fails, returns false, and |*time| will not be |
| 213 // updated. | 213 // updated. |
| 214 bool ParseCertificateDate(const base::StringPiece& raw_date, | 214 bool ParseCertificateDate(const base::StringPiece& raw_date, |
| 215 CertDateFormat format, | 215 CertDateFormat format, |
| 216 base::Time* time); | 216 base::Time* time); |
| 217 } // namespace net | 217 } // namespace net |
| 218 | 218 |
| 219 #endif // NET_BASE_X509_CERT_TYPES_H_ | 219 #endif // NET_BASE_X509_CERT_TYPES_H_ |
| OLD | NEW |