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

Unified Diff: net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java

Issue 2363653002: Cleanup unreachable cert adding code (Closed)
Patch Set: Rebased Created 4 years, 2 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
« no previous file with comments | « net/android/BUILD.gn ('k') | net/android/network_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
diff --git a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
index 125db7e3ce5dc58508da3c6cf1459300d015e9a5..9b45d982a6bc200d4a6f27720d664fe145f1d6a4 100644
--- a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
+++ b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
@@ -65,47 +65,6 @@ class AndroidNetworkLibrary {
}
/**
- * Adds a cryptographic file (User certificate, a CA certificate or
- * PKCS#12 keychain) through the system's CertInstaller activity.
- *
- * @param context current application context.
- * @param certType cryptographic file type. E.g. CertificateMimeType.X509_USER_CERT
- * @param data certificate/keychain data bytes.
- * @return true on success, false on failure.
- *
- * Note that failure only indicates that the function couldn't launch the
- * CertInstaller activity, not that the certificate/keychain was properly
- * installed to the keystore.
- */
- @CalledByNative
- public static boolean storeCertificate(Context context, int certType, byte[] data) {
- try {
- Intent intent = KeyChain.createInstallIntent();
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- switch (certType) {
- case CertificateMimeType.X509_USER_CERT:
- case CertificateMimeType.X509_CA_CERT:
- intent.putExtra(KeyChain.EXTRA_CERTIFICATE, data);
- break;
-
- case CertificateMimeType.PKCS12_ARCHIVE:
- intent.putExtra(KeyChain.EXTRA_PKCS12, data);
- break;
-
- default:
- Log.w(TAG, "invalid certificate type: " + certType);
- return false;
- }
- context.startActivity(intent);
- return true;
- } catch (ActivityNotFoundException e) {
- Log.w(TAG, "could not store crypto file: " + e);
- }
- return false;
- }
-
- /**
* @return the mime type (if any) that is associated with the file
* extension. Returns null if no corresponding mime type exists.
*/
« no previous file with comments | « net/android/BUILD.gn ('k') | net/android/network_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698