Remove the null-termination for Java string compatibility.
1. Also change the keyname delimiter in CertTool.java.
2. Return NOTFOUND if the result.len==0 in the listKeys().
3. Define the keystore states in the class Keystore.
diff --git a/keystore/java/android/security/CertTool.java b/keystore/java/android/security/CertTool.java
index 285def2..1dc575b 100644
--- a/keystore/java/android/security/CertTool.java
+++ b/keystore/java/android/security/CertTool.java
@@ -51,7 +51,7 @@
private static final String USER_CERTIFICATE = "USRCERT";
private static final String USER_KEY = "USRKEY";
- private static final String KEYNAME_DELIMITER = " ";
+ private static final String KEYNAME_DELIMITER = "_";
private static final Keystore keystore = Keystore.getInstance();
private native String generateCertificateRequest(int bits, String subject);