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> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
16 #include "base/singleton.h" | 16 #include "base/singleton.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "testing/gtest/include/gtest/gtest_prod.h" | 18 #include "testing/gtest/include/gtest/gtest_prod.h" |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 #include <windows.h> | 21 #include <windows.h> |
22 #include <wincrypt.h> | 22 #include <wincrypt.h> |
23 #elif defined(OS_MACOSX) | 23 #elif defined(OS_MACOSX) |
24 #include <Security/Security.h> | 24 #include <Security/Security.h> |
25 #elif defined(OS_LINUX) | 25 #elif defined(USE_NSS) |
26 // Forward declaration; real one in <cert.h> | 26 // Forward declaration; real one in <cert.h> |
27 struct CERTCertificateStr; | 27 struct CERTCertificateStr; |
28 #endif | 28 #endif |
29 | 29 |
30 class Pickle; | 30 class Pickle; |
31 | 31 |
32 namespace net { | 32 namespace net { |
33 | 33 |
34 class CertVerifyResult; | 34 class CertVerifyResult; |
35 | 35 |
(...skipping 22 matching lines...) Expand all Loading... |
58 bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; | 58 bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; |
59 }; | 59 }; |
60 | 60 |
61 // A handle to the certificate object in the underlying crypto library. | 61 // A handle to the certificate object in the underlying crypto library. |
62 // We assume that OSCertHandle is a pointer type on all platforms and | 62 // We assume that OSCertHandle is a pointer type on all platforms and |
63 // NULL is an invalid OSCertHandle. | 63 // NULL is an invalid OSCertHandle. |
64 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
65 typedef PCCERT_CONTEXT OSCertHandle; | 65 typedef PCCERT_CONTEXT OSCertHandle; |
66 #elif defined(OS_MACOSX) | 66 #elif defined(OS_MACOSX) |
67 typedef SecCertificateRef OSCertHandle; | 67 typedef SecCertificateRef OSCertHandle; |
68 #elif defined(OS_LINUX) | 68 #elif defined(USE_NSS) |
69 typedef struct CERTCertificateStr* OSCertHandle; | 69 typedef struct CERTCertificateStr* OSCertHandle; |
70 #else | 70 #else |
71 // TODO(ericroman): not implemented | 71 // TODO(ericroman): not implemented |
72 typedef void* OSCertHandle; | 72 typedef void* OSCertHandle; |
73 #endif | 73 #endif |
74 | 74 |
75 // Principal represent an X.509 principal. | 75 // Principal represent an X.509 principal. |
76 struct Principal { | 76 struct Principal { |
77 Principal() { } | 77 Principal() { } |
78 explicit Principal(const std::string& name) : common_name(name) { } | 78 explicit Principal(const std::string& name) : common_name(name) { } |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 // Where the certificate comes from. | 314 // Where the certificate comes from. |
315 Source source_; | 315 Source source_; |
316 | 316 |
317 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 317 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
318 }; | 318 }; |
319 | 319 |
320 } // namespace net | 320 } // namespace net |
321 | 321 |
322 #endif // NET_BASE_X509_CERTIFICATE_H_ | 322 #endif // NET_BASE_X509_CERTIFICATE_H_ |
OLD | NEW |