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

Unified Diff: net/android/network_library.h

Issue 7538029: Upstream certificate and mime Android implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DEPS Created 9 years, 5 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/network_library.h
diff --git a/net/android/network_library.h b/net/android/network_library.h
new file mode 100644
index 0000000000000000000000000000000000000000..3a31c9c4b53db0b46e13d92aaec25ce58d44ba56
--- /dev/null
+++ b/net/android/network_library.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 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.
+
+#ifndef NET_ANDROID_NETWORK_LIBRARY_H_
+#define NET_ANDROID_NETWORK_LIBRARY_H_
+#pragma once
+
+#include <jni.h>
wtc 2011/08/09 18:47:22 Add a blank line to separate the C and C++ system
michaelbai 2011/08/11 16:10:18 Done.
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+
+namespace net {
+namespace android {
+
+enum VerifyResult {
+ VERIFY_OK,
+ VERIFY_BAD_HOSTNAME,
+ VERIFY_NO_TRUSTED_ROOT,
+ VERIFY_INVOCATION_ERROR,
+};
wtc 2011/08/09 18:47:22 Document this enum type. In particular, VERIFY_IN
michaelbai 2011/08/11 16:10:18 Done.
+
+// |cert_chain| is DER encoded chain of certificates, with the server's own
+// certificate listed first.
+// |hostname| is validated against the supplied cert. |auth_type| is as per
+// the Java X509Certificate.checkServerTrusted method.
+
+VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain,
+ const std::string& hostname,
+ const std::string& auth_type);
+
+// Helper for the <keygen> handler. Passes the DER-encoded key pair via
+// JNI to the Credentials store.
+bool StoreKeyPair(const uint8* public_key,
+ size_t public_len,
+ const uint8* private_key,
+ size_t private_len);
+
+// Get the mime type (if any) that is associated with the file extension.
+// Returns true if a corresponding mime type exists.
+bool GetMimeTypeFromExtension(const std::string& extension,
+ std::string* result);
+
+bool RegisterNetworkLibrary(JNIEnv* env);
wtc 2011/08/09 18:47:22 Document this function.
michaelbai 2011/08/11 16:10:18 Done.
+
+} // namespace android
+} // namespace net
+
+#endif // NET_ANDROID_NETWORK_LIBRARY_H_
« no previous file with comments | « net/DEPS ('k') | net/android/network_library.cc » ('j') | net/android/network_library.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698