k.append(" ").append("-f");
cmdLine.add(keyFile);
k.append(" ").append(keyFile);
//cmdLine.add("-vvv");
ProcessManager pm = new ProcessManager(cmdLine);
if(logger.isLoggable(Level.FINER)) {
logger.finer("Command = " + k);
}
pm.setTimeoutMsec(DEFAULT_TIMEOUT_MSEC);
if (logger.isLoggable(Level.FINER))
pm.setEcho(true);
else
pm.setEcho(false);
int exit;
try {
exit = pm.execute();
}
catch (ProcessManagerException ex) {
logger.fine("Error while executing ssh-keygen: " + ex.getMessage());
exit = 1;
}
if (exit == 0){
logger.info(keygenCmd + " successfully generated the identification " + keyFile);
} else {
if(logger.isLoggable(Level.FINER)) {
logger.finer(pm.getStderr());
}
logger.info(keygenCmd + " failed");
}
return (exit == 0) ? true : false;