OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_CERTIFICATE_H_ | 5 #ifndef NET_BASE_X509_CERTIFICATE_H_ |
6 #define NET_BASE_X509_CERTIFICATE_H_ | 6 #define NET_BASE_X509_CERTIFICATE_H_ |
7 | 7 |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace net { | 32 namespace net { |
33 | 33 |
34 class CertVerifyResult; | 34 class CertVerifyResult; |
35 | 35 |
36 // X509Certificate represents an X.509 certificate used by SSL. | 36 // X509Certificate represents an X.509 certificate used by SSL. |
37 class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { | 37 class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { |
38 public: | 38 public: |
39 // SHA-1 fingerprint (160 bits) of a certificate. | 39 // SHA-1 fingerprint (160 bits) of a certificate. |
40 struct Fingerprint { | 40 struct Fingerprint { |
41 bool operator==(const Fingerprint& other) const { | 41 bool Equals(const Fingerprint& other) const { |
42 return memcmp(data, other.data, sizeof(data)) == 0; | 42 return memcmp(data, other.data, sizeof(data)) == 0; |
43 } | 43 } |
44 | 44 |
45 unsigned char data[20]; | 45 unsigned char data[20]; |
46 }; | 46 }; |
47 | 47 |
48 class FingerprintLessThan | 48 class FingerprintLessThan |
49 : public std::binary_function<Fingerprint, Fingerprint, bool> { | 49 : public std::binary_function<Fingerprint, Fingerprint, bool> { |
50 public: | 50 public: |
51 bool operator() (const Fingerprint& lhs, const Fingerprint& rhs) const; | 51 bool operator() (const Fingerprint& lhs, const Fingerprint& rhs) const; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 301 |
302 // Where the certificate comes from. | 302 // Where the certificate comes from. |
303 Source source_; | 303 Source source_; |
304 | 304 |
305 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 305 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
306 }; | 306 }; |
307 | 307 |
308 } // namespace net | 308 } // namespace net |
309 | 309 |
310 #endif // NET_BASE_X509_CERTIFICATE_H_ | 310 #endif // NET_BASE_X509_CERTIFICATE_H_ |
OLD | NEW |