OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ssl/ssl_add_certificate.h" | |
6 | |
7 #include <stddef.h> | |
8 | |
9 #include "net/android/network_library.h" | |
10 | |
11 namespace chrome { | |
12 | |
13 // Special case for Android here for several reasons: | |
14 // | |
15 // - The SSLAddCertHandler implementation currently only supports | |
16 // CERTIFICATE_TYPE_X509_USER_CERT, but not other types, like | |
17 // CERTIFICATE_TYPE_PKCS12_ARCHIVE which are required on this | |
18 // platform. | |
19 // | |
20 // - Besides, SSLAddCertHandler tries to parse the certificate | |
21 // by calling net::CertDatabase::CheckUserCert() which is not | |
22 // implemented on Android, mainly because there is no API | |
23 // provided by the system to do that properly. | |
24 // | |
25 // - The Android CertInstaller activity will check the certificate file | |
26 // and display a toast (small fading dialog) to the user if it is | |
27 // not valid, so the UI performed by SSLAddCertHandler would | |
28 // be redundant. | |
29 void SSLAddCertificate( | |
30 net::CertificateMimeType cert_type, | |
31 const void* cert_data, | |
32 size_t cert_size, | |
33 int /* render_process_id */, | |
34 int /* render_view_id */) { | |
35 if (cert_size > 0) { | |
36 // This launches a new activity which will run in a different process. | |
37 // It handles all user interaction, so no need to do anything in the | |
38 // browser UI thread here. | |
39 net::android::StoreCertificate(cert_type, cert_data, cert_size); | |
40 } | |
41 } | |
42 | |
43 } // namespace chrome | |
OLD | NEW |