Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Unified Diff: net/android/cert_verify_result_android.cc

Issue 108653013: Export verified_cert and public_key_hashes on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary NET_EXPORT. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/cert_verify_result_android.cc
diff --git a/net/android/cert_verify_result_android.cc b/net/android/cert_verify_result_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..aaf827ad3cc9aa3403177c2fe7a44018e6c41894
--- /dev/null
+++ b/net/android/cert_verify_result_android.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/android/cert_verify_result_android.h"
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_array.h"
+#include "jni/AndroidCertVerifyResult_jni.h"
+
+using base::android::AttachCurrentThread;
+using base::android::JavaArrayOfByteArrayToStringVector;
+
+namespace net {
+namespace android {
+
+void ExtractCertVerifyResult(jobject result,
+ CertVerifyStatusAndroid* status,
+ bool* is_issued_by_known_root,
+ std::vector<std::string>* verified_chain) {
+ JNIEnv* env = AttachCurrentThread();
+
+ *status = static_cast<CertVerifyStatusAndroid>(
+ Java_AndroidCertVerifyResult_getStatus(env, result));
+
+ *is_issued_by_known_root =
+ Java_AndroidCertVerifyResult_isIssuedByKnownRoot(env, result);
+
+ ScopedJavaLocalRef<jobjectArray> chain_byte_array =
+ Java_AndroidCertVerifyResult_getCertificateChainEncoded(env, result);
+ JavaArrayOfByteArrayToStringVector(
+ env, chain_byte_array.obj(), verified_chain);
+}
+
+bool RegisterCertVerifyResult(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace android
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698