summaryrefslogtreecommitdiffstats
path: root/net/android/network_library.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/android/network_library.cc')
-rw-r--r--net/android/network_library.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/android/network_library.cc b/net/android/network_library.cc
index b53cefe..ed538a2 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -59,6 +59,22 @@ bool StoreKeyPair(const uint8* public_key,
return ret;
}
+void StoreCertificate(net::CertificateMimeType cert_type,
+ const void* data,
+ size_t data_len) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jbyteArray> data_array =
+ ToJavaByteArray(env, reinterpret_cast<const uint8*>(data), data_len);
+ jboolean ret = Java_AndroidNetworkLibrary_storeCertificate(env,
+ GetApplicationContext(), cert_type, data_array.obj());
+ LOG_IF(WARNING, !ret) <<
+ "Call to Java_AndroidNetworkLibrary_storeCertificate"
+ " failed";
+ // Intentionally do not return 'ret', there is little the caller can
+ // do in case of failure (the CertInstaller itself will deal with
+ // incorrect data and display the appropriate toast).
+}
+
bool HaveOnlyLoopbackAddresses() {
JNIEnv* env = AttachCurrentThread();
return Java_AndroidNetworkLibrary_haveOnlyLoopbackAddresses(env);