OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ANDROID_H_ | 5 #ifndef NET_SSL_SSL_PLATFORM_KEY_ANDROID_H_ |
6 #define NET_SSL_SSL_PLATFORM_KEY_ANDROID_H_ | 6 #define NET_SSL_SSL_PLATFORM_KEY_ANDROID_H_ |
7 | 7 |
| 8 #include <jni.h> |
| 9 |
8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
9 #include "crypto/scoped_openssl_types.h" | |
10 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 | 14 |
14 class SSLPrivateKey; | 15 class SSLPrivateKey; |
15 | 16 |
16 // Wraps a ScopedEVP_PKEY into an SSLPrivateKey. | 17 // Returns a new SSLPrivateKey that uses the underlying java object |key| for |
17 NET_EXPORT scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey( | 18 // signing operations or nullptr on an error. |key| must be a |
18 crypto::ScopedEVP_PKEY key); | 19 // java.security.PrivateKey object. |
| 20 NET_EXPORT scoped_refptr<SSLPrivateKey> WrapJavaPrivateKey(jobject key); |
19 | 21 |
20 } // namespace net | 22 } // namespace net |
21 | 23 |
22 #endif // NET_SSL_SSL_PLATFORM_KEY_ANDROID_H_ | 24 #endif // NET_SSL_SSL_PLATFORM_KEY_ANDROID_H_ |
OLD | NEW |