OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef NET_SSL_CLIENT_CERT_STORE_H_ |
6 #define NET_SSL_CLIENT_CERT_STORE_H_ | 6 #define NET_SSL_CLIENT_CERT_STORE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
11 #include "net/cert/x509_certificate.h" | 11 #include "net/cert/x509_certificate.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 class SSLCertRequestInfo; | 15 class SSLCertRequestInfo; |
16 | 16 |
17 // The caller is expected to keep the ClientCertStore alive until the callback | 17 // A handle to a client certificate store to query matching certificates when a |
18 // supplied to GetClientCerts has been run. | 18 // server requests client auth. Note that there may be multiple ClientCertStore |
| 19 // objects corresponding to the same platform certificate store; each request |
| 20 // gets its own uniquely owned handle. |
19 class NET_EXPORT ClientCertStore { | 21 class NET_EXPORT ClientCertStore { |
20 public: | 22 public: |
21 virtual ~ClientCertStore() {} | 23 virtual ~ClientCertStore() {} |
22 | 24 |
23 // Get client certs matching the |cert_request_info|. On completion, the | 25 // Get client certs matching the |cert_request_info|. On completion, the |
24 // results will be stored in |selected_certs| and the |callback| will be run. | 26 // results will be stored in |selected_certs| and the |callback| will be run. |
25 // The |callback| may be called sychronously. The caller must ensure the | 27 // The |callback| may be called sychronously. The caller must ensure the |
26 // ClientCertStore and the |selected_certs| object remain alive until the | 28 // ClientCertStore, |cert_request_info|, and |selected_certs| remain alive |
27 // callback has been run. | 29 // until the callback has been run. |
28 virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info, | 30 virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info, |
29 CertificateList* selected_certs, | 31 CertificateList* selected_certs, |
30 const base::Closure& callback) = 0; | 32 const base::Closure& callback) = 0; |
31 protected: | 33 protected: |
32 ClientCertStore() {} | 34 ClientCertStore() {} |
33 | 35 |
34 private: | 36 private: |
35 DISALLOW_COPY_AND_ASSIGN(ClientCertStore); | 37 DISALLOW_COPY_AND_ASSIGN(ClientCertStore); |
36 }; | 38 }; |
37 | 39 |
38 } // namespace net | 40 } // namespace net |
39 | 41 |
40 #endif // NET_SSL_CLIENT_CERT_STORE_H_ | 42 #endif // NET_SSL_CLIENT_CERT_STORE_H_ |
OLD | NEW |