OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SSL_PLATFORM_KEY_H_ | 5 #ifndef NET_SSL_SSL_PLATFORM_KEY_H_ |
6 #define NET_SSL_SSL_PLATFORM_KEY_H_ | 6 #define NET_SSL_SSL_PLATFORM_KEY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "net/base/net_export.h" |
10 | 11 |
11 namespace base { | 12 namespace base { |
12 class SequencedTaskRunner; | 13 class SequencedTaskRunner; |
13 } | 14 } |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 | 17 |
17 class SSLPrivateKey; | 18 class SSLPrivateKey; |
18 class X509Certificate; | 19 class X509Certificate; |
19 | 20 |
| 21 using FetchPrivateKeyFunc = |
| 22 scoped_ptr<SSLPrivateKey>(X509Certificate* certificate); |
| 23 |
| 24 NET_EXPORT extern FetchPrivateKeyFunc* fetch_private_key_func; |
| 25 |
20 // Looks up the private key from the platform key store corresponding to | 26 // Looks up the private key from the platform key store corresponding to |
21 // |certificate|'s public key and returns an SSLPrivateKey which offloads | 27 // |certificate|'s public key and returns an SSLPrivateKey which offloads |
22 // signing operations to |task_runner|. |task_runner| is a SequencedTaskRunner | 28 // signing operations to |task_runner|. |task_runner| is a SequencedTaskRunner |
23 // to allow for buggy third-party smartcard drivers. | 29 // to allow for buggy third-party smartcard drivers. |
24 scoped_ptr<SSLPrivateKey> FetchClientCertPrivateKey( | 30 scoped_ptr<SSLPrivateKey> FetchClientCertPrivateKey( |
25 X509Certificate* certificate, | 31 X509Certificate* certificate, |
26 scoped_refptr<base::SequencedTaskRunner> task_runner); | 32 scoped_refptr<base::SequencedTaskRunner> task_runner); |
27 | 33 |
28 } // namespace net | 34 } // namespace net |
29 | 35 |
30 #endif // NET_SSL_SSL_PLATFORM_KEY_H_ | 36 #endif // NET_SSL_SSL_PLATFORM_KEY_H_ |
OLD | NEW |