summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
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},