簡體   English   中英

在php中生成證書請求

[英]generate a certificate request in php

我有一個表格來生成這樣的證書簽名請求 CSR

<table  width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
            <td class="TitleBar">Generate CSR</td>
            </tr>
        </table>
     <table  cellspacing="0" border="0" width="100%">

         <tr>               
            <td>Country Name(only two letters) :</td>
            <td >
            <input name="countryname" type="text"  id="countryname" MaxLength="2"/>
            </td>
        </tr>  
        <tr>                
            <td>State or Province Name :</td>
            <td> 
            <input name="province" type="text" id="province"/>
            </td>
         </tr>
         <tr>               
        <td>Locality Name :</td>
            <td >
            <input name="localityname" type="text"  id="localityname"/>
            </td>
        <tr>                
        <td>Organization Name :</td>
            <td> 
            <input name="organizationname" type="text" class="style16" id="organizationname"/>
            </td>
         </tr> 
         <tr>           
         <td>Organizational Unit Name :</td>
                <td > 
                <input name="organizationunit" type="text" id="organizationunit"/>
                </td>
         </tr>
         <tr>               
        <td>Common Name :</td>
            <td> 
            <input name="commonname" type="text"  id="commonname"/>
            </td>
         </tr>
            <tr>                
        <td>Email Address :</td>
            <td > 
            <input name="email" type="text"  id="email"/>
            </td>
         </tr>
            <tr>
            <td style="padding-top:15px padding-bottom:10px" align="right"> 
             <input name="gencsr" type="submit"  id="button" value="Generate CSR" class="FormButton" />
            </td>

            </tr></table>

輸入所有信息后,我想生成證書簽名請求

在以下路徑中我可以做什么?

#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

注意:-我想在系統命令行程序中執行此操作,請幫忙

您應該使用 php 的 ssl 模塊,而不是調用命令行程序。 要使用它生成證書,請調用openssl_csr_new函數。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM