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_NSS_H_ | 5 #ifndef NET_SSL_CLIENT_CERT_STORE_NSS_H_ |
6 #define NET_SSL_CLIENT_CERT_STORE_NSS_H_ | 6 #define NET_SSL_CLIENT_CERT_STORE_NSS_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
12 #include "net/ssl/client_cert_store.h" | 13 #include "net/ssl/client_cert_store.h" |
13 | 14 |
14 typedef struct CERTCertListStr CERTCertList; | 15 typedef struct CERTCertListStr CERTCertList; |
15 | 16 |
16 namespace crypto { | 17 namespace crypto { |
17 class CryptoModuleBlockingPasswordDelegate; | 18 class CryptoModuleBlockingPasswordDelegate; |
18 } | 19 } |
19 | 20 |
20 namespace net { | 21 namespace net { |
(...skipping 20 matching lines...) Expand all Loading... |
41 // will be removed. | 42 // will be removed. |
42 // Must be called from a worker thread. | 43 // Must be called from a worker thread. |
43 static void FilterCertsOnWorkerThread(const CertificateList& certs, | 44 static void FilterCertsOnWorkerThread(const CertificateList& certs, |
44 const SSLCertRequestInfo& request, | 45 const SSLCertRequestInfo& request, |
45 CertificateList* filtered_certs); | 46 CertificateList* filtered_certs); |
46 | 47 |
47 // Retrieves all client certificates that are stored by NSS and adds them to | 48 // Retrieves all client certificates that are stored by NSS and adds them to |
48 // |certs|. |password_delegate| is used to unlock slots if required. | 49 // |certs|. |password_delegate| is used to unlock slots if required. |
49 // Must be called from a worker thread. | 50 // Must be called from a worker thread. |
50 static void GetPlatformCertsOnWorkerThread( | 51 static void GetPlatformCertsOnWorkerThread( |
51 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> | 52 std::unique_ptr<crypto::CryptoModuleBlockingPasswordDelegate> |
52 password_delegate, | 53 password_delegate, |
53 net::CertificateList* certs); | 54 net::CertificateList* certs); |
54 | 55 |
55 private: | 56 private: |
56 void GetAndFilterCertsOnWorkerThread( | 57 void GetAndFilterCertsOnWorkerThread( |
57 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> | 58 std::unique_ptr<crypto::CryptoModuleBlockingPasswordDelegate> |
58 password_delegate, | 59 password_delegate, |
59 const SSLCertRequestInfo* request, | 60 const SSLCertRequestInfo* request, |
60 CertificateList* selected_certs); | 61 CertificateList* selected_certs); |
61 | 62 |
62 // The factory for creating the delegate for requesting a password to a | 63 // The factory for creating the delegate for requesting a password to a |
63 // PKCS#11 token. May be null. | 64 // PKCS#11 token. May be null. |
64 PasswordDelegateFactory password_delegate_factory_; | 65 PasswordDelegateFactory password_delegate_factory_; |
65 | 66 |
66 DISALLOW_COPY_AND_ASSIGN(ClientCertStoreNSS); | 67 DISALLOW_COPY_AND_ASSIGN(ClientCertStoreNSS); |
67 }; | 68 }; |
68 | 69 |
69 } // namespace net | 70 } // namespace net |
70 | 71 |
71 #endif // NET_SSL_CLIENT_CERT_STORE_NSS_H_ | 72 #endif // NET_SSL_CLIENT_CERT_STORE_NSS_H_ |
OLD | NEW |