* @throws RepositoryException
*/
protected void createSSLCertificateDatabase(RepositoryConfig config,
String masterPassword) {
try {
final PEFileLayout layout = getFileLayout(config);
final File keystore = layout.getKeyStore();
createKeyStore(keystore, config, masterPassword);
createTrustStore(config, masterPassword);
}
catch (RepositoryException re) {
String msg = _strMgr.getString("SomeProblemWithKeytool", re.getMessage());
System.err.println(msg);
try {
PEFileLayout lo = getFileLayout(config);
File src = lo.getKeyStoreTemplate();
File dest = lo.getKeyStore();
FileUtils.copy(src, dest); //keystore goes first
src = lo.getTrustStoreTemplate();
dest = lo.getTrustStore();
FileUtils.copy(src, dest); //and then cacerts with CA-signed certs
}
catch (Exception e) {
getLogger().log(Level.SEVERE, UNHANDLED_EXCEPTION, e);
}