*/
protected void createTrustStore(
RepositoryConfig config, String masterPassword) throws RepositoryException
{
//copy the default truststore from the installation template directory
final PEFileLayout layout = getFileLayout(config);
final File src = layout.getTrustStoreTemplate();
final File truststore = layout.getTrustStore();
File certFile = null;
try {
FileUtils.copy(src, truststore);
} catch (IOException ioe) {
throw new RepositoryException(
_strMgr.getString("trustStoreNotCreated", truststore), ioe);
}
try {
String[] input = {masterPassword};
String[] keytoolCmd = null;
KeytoolExecutor p = null;
changeKeystorePassword(DEFAULT_MASTER_PASSWORD, masterPassword, truststore);
//export the newly created certificate from the keystore
certFile = new File(layout.getConfigRoot(), CERTIFICATE_ALIAS + ".cer");
keytoolCmd = new String[] {
"-export",
"-keystore", layout.getKeyStore().getAbsolutePath(),
"-alias", CERTIFICATE_ALIAS,
"-file", certFile.getAbsolutePath(),
};
p = new KeytoolExecutor(keytoolCmd, 30, input);