OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_ANDROID_KEYSTORE_OPENSSL_H |
| 6 #define NET_ANDROID_KEYSTORE_OPENSSL_H |
| 7 |
| 8 #include <jni.h> |
| 9 #include <openssl/evp.h> |
| 10 |
| 11 namespace net { |
| 12 namespace android { |
| 13 |
| 14 // Create a custom OpenSSL EVP_PKEY instance that wraps a platform |
| 15 // java.security.PrivateKey object, and will call the platform APIs |
| 16 // through JNI to implement signing (and only signing). |
| 17 // |
| 18 // This shall only be used to implement client certificate handling. |
| 19 // |
| 20 // |private_key| is a JNI local (or global) reference to the Java |
| 21 // PrivateKey object. |
| 22 // |
| 23 // Returns a new EVP_PKEY* object with the following features: |
| 24 // |
| 25 // - Only contains a private key. |
| 26 // |
| 27 // - Owns its own _global_ JNI reference to the object. This means the |
| 28 // caller can free |private_key| safely after the call, and that the |
| 29 // the returned EVP_PKEY instance can be used from any thread. |
| 30 // |
| 31 // - Uses a custom method to implement the minimum functions required to |
| 32 // *sign* the digest that is part of the "Verify Certificate" message |
| 33 // during the OpenSSL handshake. Anything else will result in an |
| 34 // error returned to OpenSSL. |
| 35 // |
| 36 EVP_PKEY* GetOpenSSLPrivateKeyWrapper(jobject private_key); |
| 37 |
| 38 } // namespace android |
| 39 } // namespace net |
| 40 |
| 41 #endif // NET_ANDROID_KEYSTORE_OPENSSL_H |
OLD | NEW |