| 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/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.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 #include "net/ssl/client_cert_identity.h" |
| 12 | 13 |
| 13 namespace net { | 14 namespace net { |
| 14 | 15 |
| 15 class SSLCertRequestInfo; | 16 class SSLCertRequestInfo; |
| 16 | 17 |
| 17 // A handle to a client certificate store to query matching certificates when a | 18 // A handle to a client certificate store to query matching certificates when a |
| 18 // server requests client auth. Note that there may be multiple ClientCertStore | 19 // server requests client auth. Note that there may be multiple ClientCertStore |
| 19 // objects corresponding to the same platform certificate store; each request | 20 // objects corresponding to the same platform certificate store; each request |
| 20 // gets its own uniquely owned handle. | 21 // gets its own uniquely owned handle. |
| 21 class NET_EXPORT ClientCertStore { | 22 class NET_EXPORT ClientCertStore { |
| 22 public: | 23 public: |
| 23 virtual ~ClientCertStore() {} | 24 virtual ~ClientCertStore() {} |
| 24 | 25 |
| 25 using ClientCertListCallback = base::Callback<void(CertificateList)>; | 26 using ClientCertListCallback = base::Callback<void(ClientCertIdentityList)>; |
| 26 | 27 |
| 27 // Get client certs matching the |cert_request_info|. On completion, the | 28 // Get client certs matching the |cert_request_info| and pass them to the |
| 28 // results will be stored in |selected_certs| and the |callback| will be run. | 29 // |callback|. The |callback| may be called sychronously. The caller must |
| 29 // The |callback| may be called sychronously. The caller must ensure the | 30 // ensure the ClientCertStore and |cert_request_info| remain alive until the |
| 30 // ClientCertStore and |cert_request_info| remain alive until the callback | 31 // callback has been run. |
| 31 // has been run. | |
| 32 virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info, | 32 virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info, |
| 33 const ClientCertListCallback& callback) = 0; | 33 const ClientCertListCallback& callback) = 0; |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 ClientCertStore() {} | 36 ClientCertStore() {} |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(ClientCertStore); | 39 DISALLOW_COPY_AND_ASSIGN(ClientCertStore); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace net | 42 } // namespace net |
| 43 | 43 |
| 44 #endif // NET_SSL_CLIENT_CERT_STORE_H_ | 44 #endif // NET_SSL_CLIENT_CERT_STORE_H_ |
| OLD | NEW |