Index: net/android/keystore.cc |
diff --git a/net/android/keystore.cc b/net/android/keystore.cc |
index a3d8cc1771f478bee877b835b2ee3d24fa085bfe..8cd2136927dfcda02dd5f6a1e03ac6dcf9bcd9ef 100644 |
--- a/net/android/keystore.cc |
+++ b/net/android/keystore.cc |
@@ -10,7 +10,7 @@ |
#include "base/android/jni_array.h" |
#include "base/logging.h" |
-#include "jni/AndroidKeyStore_jni.h" |
+#include "jni/AndroidKeyStoreBridge_jni.h" |
bulach
2014/02/14 10:45:29
if my suggestion above works, then this will becom
Yaron
2014/02/14 19:36:56
Done.
|
using base::android::AttachCurrentThread; |
using base::android::HasException; |
@@ -28,7 +28,7 @@ bool GetRSAKeyModulus( |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jbyteArray> modulus_ref = |
- Java_AndroidKeyStore_getRSAKeyModulus(env, private_key_ref); |
+ Java_AndroidKeyStoreBridge_getRSAKeyModulus(env, private_key_ref); |
if (modulus_ref.is_null()) |
return false; |
@@ -41,7 +41,7 @@ bool GetDSAKeyParamQ(jobject private_key_ref, |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jbyteArray> q_ref = |
- Java_AndroidKeyStore_getDSAKeyParamQ(env, private_key_ref); |
+ Java_AndroidKeyStoreBridge_getDSAKeyParamQ(env, private_key_ref); |
if (q_ref.is_null()) |
return false; |
@@ -54,7 +54,7 @@ bool GetECKeyOrder(jobject private_key_ref, |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jbyteArray> order_ref = |
- Java_AndroidKeyStore_getECKeyOrder(env, private_key_ref); |
+ Java_AndroidKeyStoreBridge_getECKeyOrder(env, private_key_ref); |
if (order_ref.is_null()) |
return false; |
@@ -67,7 +67,7 @@ bool GetPrivateKeyEncodedBytes(jobject private_key, |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jbyteArray> encoded_ref = |
- Java_AndroidKeyStore_getPrivateKeyEncodedBytes(env, private_key); |
+ Java_AndroidKeyStoreBridge_getPrivateKeyEncodedBytes(env, private_key); |
if (encoded_ref.is_null()) |
return false; |
@@ -90,7 +90,7 @@ bool RawSignDigestWithPrivateKey( |
// Invoke platform API |
ScopedJavaLocalRef<jbyteArray> signature_ref = |
- Java_AndroidKeyStore_rawSignDigestWithPrivateKey( |
+ Java_AndroidKeyStoreBridge_rawSignDigestWithPrivateKey( |
env, private_key_ref, digest_ref.obj()); |
if (HasException(env) || signature_ref.is_null()) |
return false; |
@@ -102,7 +102,7 @@ bool RawSignDigestWithPrivateKey( |
PrivateKeyType GetPrivateKeyType(jobject private_key) { |
JNIEnv* env = AttachCurrentThread(); |
- int type = Java_AndroidKeyStore_getPrivateKeyType( |
+ int type = Java_AndroidKeyStoreBridge_getPrivateKeyType( |
env, private_key); |
return static_cast<PrivateKeyType>(type); |
} |
@@ -118,10 +118,16 @@ EVP_PKEY* GetOpenSSLSystemHandleForPrivateKey(jobject private_key) { |
// this won't be a problem in the far future (e.g. when Android gets |
// ported to 64-bit environments, if ever). |
int pkey = |
- Java_AndroidKeyStore_getOpenSSLHandleForPrivateKey(env, private_key); |
+ Java_AndroidKeyStoreBridge_getOpenSSLHandleForPrivateKey(env, private_key); |
return reinterpret_cast<EVP_PKEY*>(pkey); |
} |
+void ReleaseKey(jobject private_key) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ Java_AndroidKeyStoreBridge_releaseKey(env, private_key); |
+ env->DeleteGlobalRef(private_key); |
+} |
+ |
bool RegisterKeyStore(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |