summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2009-07-04 22:19:51 +0800
committerChung-yih Wang <cywang@google.com>2009-07-05 11:06:01 +0800
commit699ca3f2518360ea3250ff5a0e5d39e122c64a91 (patch)
treedcdeefe39f5cb52cc02d63039be4c9a4427eb9bc /keystore
parent4492bcb851f4ee862a446664eb9045045ebb7b5e (diff)
downloadframeworks_base-699ca3f2518360ea3250ff5a0e5d39e122c64a91.zip
frameworks_base-699ca3f2518360ea3250ff5a0e5d39e122c64a91.tar.gz
frameworks_base-699ca3f2518360ea3250ff5a0e5d39e122c64a91.tar.bz2
Add password field for WiFi configuration.
1. the certtool.h is modified for avoiding the side effect, for saving the configuration with wpa_supplicant. 2. put the loadLibrary back in CertTool.java 3. Fix incorrect JNI declarations.
Diffstat (limited to 'keystore')
-rw-r--r--keystore/java/android/security/CertTool.java12
-rw-r--r--keystore/jni/certtool.c4
2 files changed, 11 insertions, 5 deletions
diff --git a/keystore/java/android/security/CertTool.java b/keystore/java/android/security/CertTool.java
index 5319330..26d22ae 100644
--- a/keystore/java/android/security/CertTool.java
+++ b/keystore/java/android/security/CertTool.java
@@ -30,6 +30,10 @@ import android.text.TextUtils;
* {@hide}
*/
public class CertTool {
+ static {
+ System.loadLibrary("certtool_jni");
+ }
+
public static final String ACTION_ADD_CREDENTIAL =
"android.security.ADD_CREDENTIAL";
public static final String KEY_TYPE_NAME = "typeName";
@@ -52,7 +56,7 @@ public class CertTool {
private static final String USER_KEY = "USRKEY";
private static final String KEYNAME_DELIMITER = "_";
- private static final Keystore keystore = Keystore.getInstance();
+ private static final Keystore sKeystore = Keystore.getInstance();
private native String generateCertificateRequest(int bits, String subject);
private native boolean isPkcs12Keystore(byte[] data);
@@ -65,6 +69,8 @@ public class CertTool {
private static CertTool singleton = null;
+ private CertTool() { }
+
public static final CertTool getInstance() {
if (singleton == null) {
singleton = new CertTool();
@@ -85,11 +91,11 @@ public class CertTool {
}
public String[] getAllUserCertificateKeys() {
- return keystore.listKeys(USER_KEY);
+ return sKeystore.listKeys(USER_KEY);
}
public String[] getAllCaCertificateKeys() {
- return keystore.listKeys(CA_CERTIFICATE);
+ return sKeystore.listKeys(CA_CERTIFICATE);
}
public String[] getSupportedKeyStrenghs() {
diff --git a/keystore/jni/certtool.c b/keystore/jni/certtool.c
index c2a137e..fabf5cd 100644
--- a/keystore/jni/certtool.c
+++ b/keystore/jni/certtool.c
@@ -115,9 +115,9 @@ static JNINativeMethod gCertToolMethods[] = {
/* name, signature, funcPtr */
{"generateCertificateRequest", "(ILjava/lang/String;)Ljava/lang/String;",
(void*)android_security_CertTool_generateCertificateRequest},
- {"isPkcs12Keystore", "(B[)I",
+ {"isPkcs12Keystore", "([B)Z",
(void*)android_security_CertTool_isPkcs12Keystore},
- {"generateX509Certificate", "(B[)I",
+ {"generateX509Certificate", "([B)I",
(void*)android_security_CertTool_generateX509Certificate},
{"isCaCertificate", "(I)Z",
(void*)android_security_CertTool_isCaCertificate},