📄 function.openssl-csr-new.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Generates a CSR</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-csr-get-subject.html">openssl_csr_get_subject</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-csr-sign.html">openssl_csr_sign</a></div> <div class="up"><a href="ref.openssl.html">OpenSSL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.openssl-csr-new" class="refentry"> <div class="refnamediv"> <h1 class="refname">openssl_csr_new</h1> <p class="verinfo">(PHP 4 >= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">openssl_csr_new</span> — <span class="dc-title">Generates a CSR</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><b><b>openssl_csr_new</b></b></span> ( <span class="methodparam"><span class="type">array</span> <tt class="parameter">$dn</tt></span> , <span class="methodparam"><span class="type">resource</span> <tt class="parameter reference">&$privkey</tt></span> [, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$configargs</tt></span> [, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$extraattribs</tt></span> ]] )</div> <p class="para rdfs-comment"> <b>openssl_csr_new()</b> generates a new CSR (Certificate Signing Request) based on the information provided by <i><tt class="parameter">dn</tt></i>, which represents the Distinguished Name to be used in the certificate. </p> <blockquote><p><b class="note">Note</b>: <span class="simpara"> You need to have a valid <var class="filename">openssl.cnf</var> installed for this function to operate correctly. See the notes under <a href="openssl.installation.html" class="link">the installation section</a> for more information. </span></p></blockquote> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">dn</tt></i></span> <dd> <p class="para"> The Distinguished Name to be used in the certificate. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">privkey</tt></i></span> <dd> <p class="para"> <i><tt class="parameter">privkey</tt></i> should be set to a private key that was previously generated by <a href="function.openssl-pkey-new.html" class="function">openssl_pkey_new()</a> (or otherwise obtained from the other openssl_pkey family of functions). The corresponding public portion of the key will be used to sign the CSR. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">configargs</tt></i></span> <dd> <p class="para"> By default, the information in your system <i>openssl.conf</i> is used to initialize the request; you can specify a configuration file section by setting the <i>config_section_section</i> key of <i><tt class="parameter">configargs</tt></i>. You can also specify an alternative openssl configuration file by setting the value of the <i>config</i> key to the path of the file you want to use. The following keys, if present in <i><tt class="parameter">configargs</tt></i> behave as their equivalents in the <i>openssl.conf</i>, as listed in the table below. <table border="5"> <caption><b>Configuration overrides</b></caption> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1"><i><tt class="parameter">configargs</tt></i> key</th> <th colspan="1">type</th> <th colspan="1"><i>openssl.conf</i> equivalent</th> <th colspan="1">description</th> </tr> </thead> <tbody valign="middle" class="tbody">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -