title: generate a certificate request in php
body: <p>I have a table to generate Certificate Signing Request CSR like this</p>
  
  <pre><code>&lt;table  width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
              &lt;tr&gt; 
              &lt;td class="TitleBar"&gt;Generate CSR&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
       &lt;table  cellspacing="0" border="0" width="100%"&gt;
  
           &lt;tr&gt;               
              &lt;td&gt;Country Name(only two letters) :&lt;/td&gt;
              &lt;td &gt;
              &lt;input name="countryname" type="text"  id="countryname" MaxLength="2"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;  
          &lt;tr&gt;                
              &lt;td&gt;State or Province Name :&lt;/td&gt;
              &lt;td&gt; 
              &lt;input name="province" type="text" id="province"/&gt;
              &lt;/td&gt;
           &lt;/tr&gt;
           &lt;tr&gt;               
          &lt;td&gt;Locality Name :&lt;/td&gt;
              &lt;td &gt;
              &lt;input name="localityname" type="text"  id="localityname"/&gt;
              &lt;/td&gt;
          &lt;tr&gt;                
          &lt;td&gt;Organization Name :&lt;/td&gt;
              &lt;td&gt; 
              &lt;input name="organizationname" type="text" class="style16" id="organizationname"/&gt;
              &lt;/td&gt;
           &lt;/tr&gt; 
           &lt;tr&gt;           
           &lt;td&gt;Organizational Unit Name :&lt;/td&gt;
                  &lt;td &gt; 
                  &lt;input name="organizationunit" type="text" id="organizationunit"/&gt;
                  &lt;/td&gt;
           &lt;/tr&gt;
           &lt;tr&gt;               
          &lt;td&gt;Common Name :&lt;/td&gt;
              &lt;td&gt; 
              &lt;input name="commonname" type="text"  id="commonname"/&gt;
              &lt;/td&gt;
           &lt;/tr&gt;
              &lt;tr&gt;                
          &lt;td&gt;Email Address :&lt;/td&gt;
              &lt;td &gt; 
              &lt;input name="email" type="text"  id="email"/&gt;
              &lt;/td&gt;
           &lt;/tr&gt;
              &lt;tr&gt;
              &lt;td style="padding-top:15px padding-bottom:10px" align="right"&gt; 
               &lt;input name="gencsr" type="submit"  id="button" value="Generate CSR" class="FormButton" /&gt;
              &lt;/td&gt;
  
              &lt;/tr&gt;&lt;/table&gt;
  </code></pre>
  
  <p>After entering all information, i want to generate certificate signing request </p>
  
  <p>In the following path what i can do?</p>
  
  <pre><code>#Generating a cert request
  openssl req -new -nodes -out /portal/data/config/certificate/vendor/requests/couffin-req.pem -keyout /portal/data/config/certificate/vendor/requests/couffin-req.key -subj "/C=IN/ST=MAHARASHTRA/L=MUMBAI/O=Couffin Inc/OU=Sales/CN=www.couffin.itpl" -config /portal/data/config/certificate/vendor/openssl.cnf
  
  #Signing a cert request
  openssl ca -policy policy_anything -batch -out /portal/data/config/certificate/vendor/certs/couffin-cert.pem -config /portal/data/config/certificate/vendor/conf/openssl.cnf -infiles /portal/data/config/certificate/vendor/requests/couffin-req.pem
  </code></pre>
  
  <p>Note :- I want to do it in system command-line programs, please help</p>