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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_NETWORK_LIBRARY_H_
6 #define NET_ANDROID_NETWORK_LIBRARY_H_
7 #pragma once
8
9 #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.
10 #include <string>
11 #include <vector>
12
13 #include "base/basictypes.h"
14
15 namespace net {
16 namespace android {
17
18 enum VerifyResult {
19 VERIFY_OK,
20 VERIFY_BAD_HOSTNAME,
21 VERIFY_NO_TRUSTED_ROOT,
22 VERIFY_INVOCATION_ERROR,
23 };
wtc 2011/08/09 18:47:22 Document this enum type. In particular, VERIFY_IN
michaelbai 2011/08/11 16:10:18 Done.
24
25 // |cert_chain| is DER encoded chain of certificates, with the server's own
26 // certificate listed first.
27 // |hostname| is validated against the supplied cert. |auth_type| is as per
28 // the Java X509Certificate.checkServerTrusted method.
29
30 VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain,
31 const std::string& hostname,
32 const std::string& auth_type);
33
34 // Helper for the <keygen> handler. Passes the DER-encoded key pair via
35 // JNI to the Credentials store.
36 bool StoreKeyPair(const uint8* public_key,
37 size_t public_len,
38 const uint8* private_key,
39 size_t private_len);
40
41 // Get the mime type (if any) that is associated with the file extension.
42 // Returns true if a corresponding mime type exists.
43 bool GetMimeTypeFromExtension(const std::string& extension,
44 std::string* result);
45
46 bool RegisterNetworkLibrary(JNIEnv* env);
wtc 2011/08/09 18:47:22 Document this function.
michaelbai 2011/08/11 16:10:18 Done.
47
48 } // namespace android
49 } // namespace net
50
51 #endif // NET_ANDROID_NETWORK_LIBRARY_H_
OLDNEW
« 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