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

Side by Side Diff: net/android/network_library.h

Issue 11316210: Implement TestRootCerts for Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address Ryan's remarks Created 8 years 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
« no previous file with comments | « net/android/java/src/org/chromium/net/X509Util.java ('k') | net/android/network_library.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_ANDROID_NETWORK_LIBRARY_H_ 5 #ifndef NET_ANDROID_NETWORK_LIBRARY_H_
6 #define NET_ANDROID_NETWORK_LIBRARY_H_ 6 #define NET_ANDROID_NETWORK_LIBRARY_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 16 matching lines...) Expand all
27 VERIFY_INVOCATION_ERROR, 27 VERIFY_INVOCATION_ERROR,
28 }; 28 };
29 29
30 // |cert_chain| is DER encoded chain of certificates, with the server's own 30 // |cert_chain| is DER encoded chain of certificates, with the server's own
31 // certificate listed first. 31 // certificate listed first.
32 // |auth_type| is as per the Java X509Certificate.checkServerTrusted method. 32 // |auth_type| is as per the Java X509Certificate.checkServerTrusted method.
33 33
34 VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain, 34 VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain,
35 const std::string& auth_type); 35 const std::string& auth_type);
36 36
37 // Adds a certificate as a root trust certificate to the trust manager.
38 // |cert| is DER encoded certificate, |len| is its length in bytes.
39 void AddTestRootCertificate(const uint8* cert, size_t len);
40
41 // Removes all root certificates added by |AddTestRootCertificate| calls.
42 void ClearTestRootCertificates();
43
37 // Helper for the <keygen> handler. Passes the DER-encoded key pair via 44 // Helper for the <keygen> handler. Passes the DER-encoded key pair via
38 // JNI to the Credentials store. Note that the public key must be a DER 45 // JNI to the Credentials store. Note that the public key must be a DER
39 // encoded SubjectPublicKeyInfo (X.509), as returned by i2d_PUBKEY() 46 // encoded SubjectPublicKeyInfo (X.509), as returned by i2d_PUBKEY()
40 // (and *not* i2d_PublicKey(), which returns a PKCS#1 key). 47 // (and *not* i2d_PublicKey(), which returns a PKCS#1 key).
41 // 48 //
42 // Also, the private key must be in PKCS#8 format, as returned by 49 // Also, the private key must be in PKCS#8 format, as returned by
43 // i2d_PKCS8_PRIV_KEY_INFO(EVP_PKEY2PKCS8(pkey)), which is a different 50 // i2d_PKCS8_PRIV_KEY_INFO(EVP_PKEY2PKCS8(pkey)), which is a different
44 // format than what i2d_PrivateKey() returns, so don't use it either. 51 // format than what i2d_PrivateKey() returns, so don't use it either.
45 // 52 //
46 bool StoreKeyPair(const uint8* public_key, 53 bool StoreKeyPair(const uint8* public_key,
(...skipping 23 matching lines...) Expand all
70 bool GetMimeTypeFromExtension(const std::string& extension, 77 bool GetMimeTypeFromExtension(const std::string& extension,
71 std::string* result); 78 std::string* result);
72 79
73 // Register JNI methods 80 // Register JNI methods
74 NET_EXPORT bool RegisterNetworkLibrary(JNIEnv* env); 81 NET_EXPORT bool RegisterNetworkLibrary(JNIEnv* env);
75 82
76 } // namespace android 83 } // namespace android
77 } // namespace net 84 } // namespace net
78 85
79 #endif // NET_ANDROID_NETWORK_LIBRARY_H_ 86 #endif // NET_ANDROID_NETWORK_LIBRARY_H_
OLDNEW
« no previous file with comments | « net/android/java/src/org/chromium/net/X509Util.java ('k') | net/android/network_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698