summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/CertTool.java
diff options
context:
space:
mode:
authorHuahui Wu <hwu@google.com>2011-01-26 22:11:02 -0800
committerHuahui Wu <hwu@google.com>2011-01-27 09:51:37 -0800
commitc7939b1750ba98ab745110a138209d8b981fdc21 (patch)
treef2cfef72a8c0a20bdc040b8501a4ec556c050805 /core/java/android/webkit/CertTool.java
parentc291a7bf7a163cea10be135279103f72a6418383 (diff)
downloadframeworks_base-c7939b1750ba98ab745110a138209d8b981fdc21.zip
frameworks_base-c7939b1750ba98ab745110a138209d8b981fdc21.tar.gz
frameworks_base-c7939b1750ba98ab745110a138209d8b981fdc21.tar.bz2
b/3347670 Support installing online certs to the system keystore.
Requires another CL in external/webkit. https://android-git.corp.google.com/g/#change,93328 Change-Id: I33d642d370ddf330199f2b296d5f8b08923e49cd
Diffstat (limited to 'core/java/android/webkit/CertTool.java')
-rw-r--r--core/java/android/webkit/CertTool.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/webkit/CertTool.java b/core/java/android/webkit/CertTool.java
index d25d970..4c534f9 100644
--- a/core/java/android/webkit/CertTool.java
+++ b/core/java/android/webkit/CertTool.java
@@ -29,6 +29,7 @@ import android.util.Log;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
+import java.util.HashMap;
class CertTool {
private static final String LOGTAG = "CertTool";
@@ -39,6 +40,14 @@ class CertTool {
static final String CERT = Credentials.CERTIFICATE;
static final String PKCS12 = Credentials.PKCS12;
+ private static HashMap<String, String> sCertificateTypeMap;
+ static {
+ sCertificateTypeMap = new HashMap<String, String>();
+ sCertificateTypeMap.put("application/x-x509-ca-cert", CertTool.CERT);
+ sCertificateTypeMap.put("application/x-x509-user-cert", CertTool.CERT);
+ sCertificateTypeMap.put("application/x-pkcs12", CertTool.PKCS12);
+ }
+
static String[] getKeyStrengthList() {
return new String[] {"High Grade", "Medium Grade"};
}
@@ -66,5 +75,9 @@ class CertTool {
Credentials.getInstance().install(context, type, value);
}
+ static String getCertType(String mimeType) {
+ return sCertificateTypeMap.get(mimeType);
+ }
+
private CertTool() {}
}