private void generateServerCertificate() {
    LOG.info("Generation of server certificate");

    Map<String, String> configsMap = configs.getConfigsMap();
    String srvrKstrDir = configsMap.get(Configuration.SRVR_KSTR_DIR.getKey());
    String srvrCrtName = configsMap.get(Configuration.SRVR_CRT_NAME.getKey());
    String srvrCsrName = configsMap.get(Configuration.SRVR_CSR_NAME.getKey());
    String srvrKeyName = configsMap.get(Configuration.SRVR_KEY_NAME.getKey());
    String kstrName = configsMap.get(Configuration.KSTR_NAME.getKey());
    String srvrCrtPass = configsMap.get(Configuration.SRVR_CRT_PASS.getKey());
    String srvrCrtPassFile =  configsMap.get(Configuration.SRVR_CRT_PASS_FILE.getKey());

    Object[] scriptArgs = {srvrCrtPass, srvrKstrDir, srvrKeyName,
        srvrCrtName, kstrName, srvrCsrName};

    String command = MessageFormat.format(GEN_SRVR_KEY,scriptArgs);
    runCommand(command);

    command = MessageFormat.format(GEN_SRVR_REQ,scriptArgs);
    runCommand(command);

    command = MessageFormat.format(SIGN_SRVR_CRT,scriptArgs);
    runCommand(command);

    command = MessageFormat.format(EXPRT_KSTR,scriptArgs);
    runCommand(command);

    command = String.format(SET_PERMISSIONS,srvrKstrDir);
    runCommand(command);

    command = String.format(SET_SERVER_PASS_FILE_PERMISSIONS, srvrKstrDir + File.separator + srvrCrtPassFile);
    runCommand(command);
  }
Runs os command

@return command execution exit code
ambari-server/src/main/java/org/apache/ambari/server/security/CertificateManager.java