OLD | NEW |
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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "net/android/cert_verify_result_android.h" | 14 #include "net/android/cert_verify_result_android.h" |
15 #include "net/base/mime_util.h" | 15 #include "net/base/mime_util.h" |
16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 namespace android { | 19 namespace android { |
20 | 20 |
21 // |cert_chain| is DER encoded chain of certificates, with the server's own | 21 // |cert_chain| is DER encoded chain of certificates, with the server's own |
22 // certificate listed first. | 22 // certificate listed first. |
23 // |auth_type| is as per the Java X509Certificate.checkServerTrusted method. | 23 // |auth_type| is as per the Java X509Certificate.checkServerTrusted method. |
24 CertVerifyResultAndroid VerifyX509CertChain( | 24 void VerifyX509CertChain(const std::vector<std::string>& cert_chain, |
25 const std::vector<std::string>& cert_chain, | 25 const std::string& auth_type, |
26 const std::string& auth_type); | 26 const std::string& host, |
| 27 CertVerifyStatusAndroid* status, |
| 28 bool* is_issued_by_known_root, |
| 29 std::vector<std::string>* verified_chain); |
27 | 30 |
28 // Adds a certificate as a root trust certificate to the trust manager. | 31 // Adds a certificate as a root trust certificate to the trust manager. |
29 // |cert| is DER encoded certificate, |len| is its length in bytes. | 32 // |cert| is DER encoded certificate, |len| is its length in bytes. |
30 void AddTestRootCertificate(const uint8* cert, size_t len); | 33 void AddTestRootCertificate(const uint8* cert, size_t len); |
31 | 34 |
32 // Removes all root certificates added by |AddTestRootCertificate| calls. | 35 // Removes all root certificates added by |AddTestRootCertificate| calls. |
33 void ClearTestRootCertificates(); | 36 void ClearTestRootCertificates(); |
34 | 37 |
35 // Helper for the <keygen> handler. Passes the DER-encoded key pair via | 38 // Helper for the <keygen> handler. Passes the DER-encoded key pair via |
36 // JNI to the Credentials store. Note that the public key must be a DER | 39 // JNI to the Credentials store. Note that the public key must be a DER |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool GetMimeTypeFromExtension(const std::string& extension, | 71 bool GetMimeTypeFromExtension(const std::string& extension, |
69 std::string* result); | 72 std::string* result); |
70 | 73 |
71 // Register JNI methods | 74 // Register JNI methods |
72 NET_EXPORT bool RegisterNetworkLibrary(JNIEnv* env); | 75 NET_EXPORT bool RegisterNetworkLibrary(JNIEnv* env); |
73 | 76 |
74 } // namespace android | 77 } // namespace android |
75 } // namespace net | 78 } // namespace net |
76 | 79 |
77 #endif // NET_ANDROID_NETWORK_LIBRARY_H_ | 80 #endif // NET_ANDROID_NETWORK_LIBRARY_H_ |
OLD | NEW |