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_UTIL_H_ | 5 #ifndef NET_SSL_SSL_PLATFORM_KEY_UTIL_H_ |
6 #define NET_SSL_SSL_PLATFORM_KEY_UTIL_H_ | 6 #define NET_SSL_SSL_PLATFORM_KEY_UTIL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/single_thread_task_runner.h" |
11 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
12 #include "net/ssl/ssl_private_key.h" | 13 #include "net/ssl/ssl_private_key.h" |
13 | 14 |
14 namespace base { | |
15 class SingleThreadTaskRunner; | |
16 } | |
17 | |
18 namespace net { | 15 namespace net { |
19 | 16 |
20 class X509Certificate; | 17 class X509Certificate; |
21 | 18 |
22 // Returns a task runner to serialize all private key operations on a single | 19 // Returns a task runner to serialize all private key operations on a single |
23 // background thread to avoid problems with buggy smartcards. Its underlying | 20 // background thread to avoid problems with buggy smartcards. Its underlying |
24 // Thread is non-joinable and as such provides | 21 // Thread is non-joinable and as such provides |
25 // TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN semantics. | 22 // TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN semantics. |
26 scoped_refptr<base::SingleThreadTaskRunner> GetSSLPlatformKeyTaskRunner(); | 23 scoped_refptr<base::SingleThreadTaskRunner> GetSSLPlatformKeyTaskRunner(); |
27 | 24 |
28 // Determines the key type and maximum signature length of |certificate|'s | 25 // Determines the key type and maximum signature length of |certificate|'s |
29 // public key. | 26 // public key. |
30 NET_EXPORT_PRIVATE bool GetClientCertInfo(const X509Certificate* certificate, | 27 NET_EXPORT_PRIVATE bool GetClientCertInfo(const X509Certificate* certificate, |
31 SSLPrivateKey::Type* out_type, | 28 SSLPrivateKey::Type* out_type, |
32 size_t* out_max_length); | 29 size_t* out_max_length); |
33 | 30 |
34 } // namespace net | 31 } // namespace net |
35 | 32 |
36 #endif // NET_SSL_SSL_PLATFORM_KEY_UTIL_H_ | 33 #endif // NET_SSL_SSL_PLATFORM_KEY_UTIL_H_ |
OLD | NEW |