class CertificateManager {

  public synchronized void generateContainerCertificate(String hostname,
                                                        String identifier) {
    LOG.info("Generation of certificate for {}", hostname);

    String srvrKstrDir = SecurityUtils.getSecurityDir();
    Object[] scriptArgs = {srvrKstrDir, getSubjectDN(hostname, identifier,
        this.applicationName), identifier, SecurityUtils.getSecurityDir()};

    try {
      String command = MessageFormat.format(GEN_AGENT_KEY, scriptArgs);
      runCommand(command);

      signAgentCertificate(identifier);

    } catch (SliderException e) {
      LOG.error("Error generating the agent certificate", e);
    }
  }

}