Store CA certificate chain into one single key entry with PEM format.

Extract all CA certificates in a PKCS12 keystore into a single entry in keystore with multiple PEMs.
This commit is contained in:
Chung-yih Wang
2009-09-01 16:45:13 +08:00
parent c98d68cd56
commit 09960230bf
2 changed files with 17 additions and 17 deletions

View File

@@ -163,15 +163,9 @@ public class CertTool {
return ret;
}
}
while ((pemData = this.popPkcs12CertificateStack(handle)) != null) {
if (i++ > 0) {
if ((ret = sKeystore.put(CA_CERTIFICATE, keyname + i, pemData)) != 0) {
return ret;
}
} else {
if ((ret = sKeystore.put(CA_CERTIFICATE, keyname, pemData)) != 0) {
return ret;
}
if ((pemData = this.popPkcs12CertificateStack(handle)) != null) {
if ((ret = sKeystore.put(CA_CERTIFICATE, keyname, pemData)) != 0) {
return ret;
}
}
return 0;