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_CERTIFICATE_H_ | 5 #ifndef NET_BASE_X509_CERTIFICATE_H_ |
6 #define NET_BASE_X509_CERTIFICATE_H_ | 6 #define NET_BASE_X509_CERTIFICATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/string_piece.h" | 16 #include "base/string_piece.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "net/base/net_api.h" |
18 #include "net/base/x509_cert_types.h" | 19 #include "net/base/x509_cert_types.h" |
19 | 20 |
20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
21 #include <windows.h> | 22 #include <windows.h> |
22 #include <wincrypt.h> | 23 #include <wincrypt.h> |
23 #elif defined(OS_MACOSX) | 24 #elif defined(OS_MACOSX) |
24 #include <CoreFoundation/CFArray.h> | 25 #include <CoreFoundation/CFArray.h> |
25 #include <Security/SecBase.h> | 26 #include <Security/SecBase.h> |
26 | 27 |
27 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
(...skipping 13 matching lines...) Expand all Loading... |
41 class RSAPrivateKey; | 42 class RSAPrivateKey; |
42 } // namespace crypto | 43 } // namespace crypto |
43 | 44 |
44 namespace net { | 45 namespace net { |
45 | 46 |
46 class CertVerifyResult; | 47 class CertVerifyResult; |
47 | 48 |
48 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; | 49 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
49 | 50 |
50 // X509Certificate represents an X.509 certificate used by SSL. | 51 // X509Certificate represents an X.509 certificate used by SSL. |
51 class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { | 52 class NET_API X509Certificate |
| 53 : public base::RefCountedThreadSafe<X509Certificate> { |
52 public: | 54 public: |
53 // A handle to the certificate object in the underlying crypto library. | 55 // A handle to the certificate object in the underlying crypto library. |
54 // We assume that OSCertHandle is a pointer type on all platforms and | 56 // We assume that OSCertHandle is a pointer type on all platforms and |
55 // NULL is an invalid OSCertHandle. | 57 // NULL is an invalid OSCertHandle. |
56 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
57 typedef PCCERT_CONTEXT OSCertHandle; | 59 typedef PCCERT_CONTEXT OSCertHandle; |
58 #elif defined(OS_MACOSX) | 60 #elif defined(OS_MACOSX) |
59 typedef SecCertificateRef OSCertHandle; | 61 typedef SecCertificateRef OSCertHandle; |
60 #elif defined(USE_OPENSSL) | 62 #elif defined(USE_OPENSSL) |
61 typedef struct x509_st* OSCertHandle; | 63 typedef struct x509_st* OSCertHandle; |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 454 |
453 // Where the certificate comes from. | 455 // Where the certificate comes from. |
454 Source source_; | 456 Source source_; |
455 | 457 |
456 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 458 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
457 }; | 459 }; |
458 | 460 |
459 } // namespace net | 461 } // namespace net |
460 | 462 |
461 #endif // NET_BASE_X509_CERTIFICATE_H_ | 463 #endif // NET_BASE_X509_CERTIFICATE_H_ |
OLD | NEW |