}
// If we should also create PEM-files, do that
if (createPEM) {
String PEMfilename = mainStoreDir + "pem";
P12toPEM p12topem = new P12toPEM(ks, kspassword, true);
p12topem.setExportPath(PEMfilename);
p12topem.createPEM();
getPrintStream().println("Keystore written successfully to the directory " + PEMfilename);
} else {
FileOutputStream os = new FileOutputStream(keyStoreFilename);
ks.store(os, kspassword.toCharArray());
getPrintStream().println("Keystore written successfully to " + keyStoreFilename);