text: "use strict"
  /**
   *
   * @param certificate_file       {String} the certificate filename to generate
   * @param csr_file               {String} the certificate signing request
   * @param params                 {Object}
   * @param params.applicationUri  {String} the applicationUri
   * @param params.startDate       {Date}   startDate of the certificate
   * @param params.duration        {Number} duration in date
   * @param callback               {Function}
   */
  exports.signCertificateRequestInCA = function signCertificateRequestInCA(certificate_file, csr_file, params, callback) {
  
      assert(fs.existsSync(params.configFile));
      if (!check_certificate_filename(certificate_file)){ return callback(); }
  
      toolbox.adjustDate(params);
      toolbox.adjustApplicationUri(params);
      toolbox.processAltNames(params);
  
      var options = {cwd: params.rootDir } ;
      var configOption = " -config " + n(params.configFile);
      // this require OPENSSL_CONF to be set
      assert(fs.existsSync(process.env.OPENSSL_CONF));
  
      var tasks = [];
  
      tasks.push(displaySubtitle.bind(null, "- then we ask the authority to sign the certificate signing request"));
      tasks.push(execute_openssl.bind(null, "ca " + configOption +
          " -startdate " + toolbox.x509Date(params.startDate) +
          " -enddate " + toolbox.x509Date(params.endDate) +
          " -batch -out " + q(n(certificate_file)) + " -in " + q(n(csr_file)), options));
  
  
  
      tasks.push(displaySubtitle.bind(null, "- dump the certificate for a check"));
      tasks.push(execute_openssl.bind(null, "x509 -in " + certificate_file + "  -dates -fingerprint -purpose -noout", {}));
  
      tasks.push(displaySubtitle.bind(null, "- construct CA certificate with CRL"));
      tasks.push(constructCACertificateWithCRL.bind(null));
  
      // construct certificate chain
      //   concatenate certificate with CA Certificate and revocation list
      tasks.push(displaySubtitle.bind(null, "- construct certificate chain"));
      tasks.push(constructCertificateChain.bind(null, false, certificate_file));
  
  
      // todo
      // tasks.push(displaySubtitle.bind(null, "- verify certificate against the root CA"));
      // tasks.push(execute_openssl_no_failure.bind(null, "verify -verbose -CAfile " + config.caCertificate_With_CRL + " " + certificate_file, options));
  
      async.series(tasks, callback);
  };
  