certgen.setPublicKey(publicKey);
certgen.setSignatureAlgorithm(algorithm);
certgen.setSerialNumber(new BigInteger(String.valueOf(curr)));
// make certificate
return certgen.generateX509Certificate(privateKey);
}
private void saveKeystore(char[] password) throws KeystoreException {
try {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(keystoreFile));