OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SSL_CLIENT_CERT_STORE_WIN_H_ | 5 #ifndef NET_SSL_CLIENT_CERT_STORE_WIN_H_ |
6 #define NET_SSL_CLIENT_CERT_STORE_WIN_H_ | 6 #define NET_SSL_CLIENT_CERT_STORE_WIN_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "crypto/scoped_capi_types.h" | 10 #include "crypto/scoped_capi_types.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Takes ownership of |cert_store| and closes it at destruction time. | 22 // Takes ownership of |cert_store| and closes it at destruction time. |
23 explicit ClientCertStoreWin(HCERTSTORE cert_store); | 23 explicit ClientCertStoreWin(HCERTSTORE cert_store); |
24 | 24 |
25 ~ClientCertStoreWin() override; | 25 ~ClientCertStoreWin() override; |
26 | 26 |
27 // If a cert store has been provided at construction time GetClientCerts | 27 // If a cert store has been provided at construction time GetClientCerts |
28 // will use that. Otherwise it will use the current user's "MY" cert store | 28 // will use that. Otherwise it will use the current user's "MY" cert store |
29 // instead. | 29 // instead. |
30 void GetClientCerts(const SSLCertRequestInfo& cert_request_info, | 30 void GetClientCerts(const SSLCertRequestInfo& cert_request_info, |
31 const ClientCertListCallback& callback) override; | 31 CertificateList* selected_certs, |
| 32 const base::Closure& callback) override; |
32 | 33 |
33 private: | 34 private: |
34 using ScopedHCERTSTORE = crypto::ScopedCAPIHandle< | 35 using ScopedHCERTSTORE = crypto::ScopedCAPIHandle< |
35 HCERTSTORE, | 36 HCERTSTORE, |
36 crypto::CAPIDestroyerWithFlags<HCERTSTORE, | 37 crypto::CAPIDestroyerWithFlags<HCERTSTORE, |
37 CertCloseStore, | 38 CertCloseStore, |
38 CERT_CLOSE_STORE_CHECK_FLAG>>; | 39 CERT_CLOSE_STORE_CHECK_FLAG>>; |
39 | 40 |
40 friend class ClientCertStoreWinTestDelegate; | 41 friend class ClientCertStoreWinTestDelegate; |
41 | 42 |
42 // A hook for testing. Filters |input_certs| using the logic being used to | 43 // A hook for testing. Filters |input_certs| using the logic being used to |
43 // filter the system store when GetClientCerts() is called. | 44 // filter the system store when GetClientCerts() is called. |
44 // Implemented by creating a temporary in-memory store and filtering it | 45 // Implemented by creating a temporary in-memory store and filtering it |
45 // using the common logic. | 46 // using the common logic. |
46 bool SelectClientCertsForTesting(const CertificateList& input_certs, | 47 bool SelectClientCertsForTesting(const CertificateList& input_certs, |
47 const SSLCertRequestInfo& cert_request_info, | 48 const SSLCertRequestInfo& cert_request_info, |
48 CertificateList* selected_certs); | 49 CertificateList* selected_certs); |
49 | 50 |
50 ScopedHCERTSTORE cert_store_; | 51 ScopedHCERTSTORE cert_store_; |
51 | 52 |
52 DISALLOW_COPY_AND_ASSIGN(ClientCertStoreWin); | 53 DISALLOW_COPY_AND_ASSIGN(ClientCertStoreWin); |
53 }; | 54 }; |
54 | 55 |
55 } // namespace net | 56 } // namespace net |
56 | 57 |
57 #endif // NET_SSL_CLIENT_CERT_STORE_WIN_H_ | 58 #endif // NET_SSL_CLIENT_CERT_STORE_WIN_H_ |
OLD | NEW |