.valueOf(randomInt);
// generate a new certificate
String sigProvider = (param.getSigProvider() != null) ? param
.getSigProvider() : param.getProvider();
X509CertImpl x509cert = genX509CertImpl(sigAlgName, version, serialNr,
distinguishedName, distinguishedName, validity, existing
.getPublicKey(), privateKey, sigProvider, param.isCA());
if (param.isVerbose()) {
System.out.println("New self-signed certificate: ");
System.out.println("Version: v" + x509cert.getVersion());
System.out.println("Owner: " + x509cert.getSubjectX500Principal());
System.out.println("Issuer: " + x509cert.getIssuerX500Principal());
System.out.println("Public key: " + x509cert.getPublicKey());
System.out
.println("Signature algorithm: OID."
+ x509cert.getSigAlgOID() + ", "
+ x509cert.getSigAlgName());
System.out
.println("Serial number: "
// String.format("%x", x509cert.getSerialNumber()));
// TODO: print with String.format(..) when the
// method is
// implemented, and remove Integer.toHexString(..).
+ Integer.toHexString(x509cert.getSerialNumber()
.intValue()));
System.out.println("Validity: \n From: "
+ x509cert.getNotBefore() + "\n To: "
+ x509cert.getNotAfter());
}
// put the new certificate into the entry, associated with the alias
keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(),
new X509Certificate[] { x509cert });