-
Notifications
You must be signed in to change notification settings - Fork 102
/
openssl-spki-new.xml
168 lines (159 loc) · 5.24 KB
/
openssl-spki-new.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 5bc68add3da3cd18c40f851e944b15095d3a26aa Maintainer: duanxiaoqiang Status: ready -->
<!-- CREDITS: mowangjuanzi, Luffy -->
<refentry xml:id="function.openssl-spki-new" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>openssl_spki_new</refname>
<refpurpose>生成新的签名公钥和 challenge</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>openssl_spki_new</methodname>
<methodparam><modifier role="attribute">#[\SensitiveParameter]</modifier><type>OpenSSLAsymmetricKey</type><parameter>private_key</parameter></methodparam>
<methodparam><type>string</type><parameter>challenge</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>digest_algo</parameter><initializer><constant>OPENSSL_ALGO_MD5</constant></initializer></methodparam>
</methodsynopsis>
<para>
使用指定散列算法生成新的签名公钥和 challenge。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>private_key</parameter></term>
<listitem>
<para>
<parameter>private_key</parameter> 应该被设置为由 <function>openssl_pkey_new</function> 函数预先生成(或者以其他方式从
openssl_pkey 函数家族集中获得)的私钥。该密钥的相应公共部分将用于签署 <acronym>CSR</acronym>。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>challenge</parameter></term>
<listitem>
<para>
与 SPKAC 有关的 challenge。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>digest_algo</parameter></term>
<listitem>
<para>
摘要算法。参见 openssl_get_md_method()。
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
返回签名的公钥和 challenge,失败返回 &false;。
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
如果传递给 <parameter>digest_algo</parameter> 的参数是未知的签名算法,将会抛出 <constant>E_WARNING</constant> 级别的错误。
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>private_key</parameter> 现在接受 <classname>OpenSSLAsymmetricKey</classname>
实例;之前接受类型 <literal>OpenSSL key</literal> 的 &resource;。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="openssl_spki_new.example.basic">
<title><function>openssl_spki_new</function> 示例</title>
<para>
使用默认的摘要算法(MD5)生成新的 SPKAC
</para>
<programlisting role="php">
<![CDATA[
<?php
$pkey = openssl_pkey_new('secret password');
$spkac = openssl_spki_new($pkey, 'testing');
if ($spkac !== NULL) {
echo $spkac;
} else {
echo "SPKAC generation failed";
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
MIICRzCCAS8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM3V3sS4o4
mB9dczziRnjGAmSp+JwPrHoYMAFGvDNmZGyiWfU586X4BKs++BAj7e/FsAfno0Hd
hN9FwpCNFSox30L03nQvLYJE7f/WqigwBeMRT7Op/xvFks4sT70xP2HRYv4KqP9a
WRcKU6cFH8VxhFhqM2txEIxZKdFLaL28yT7bEDmcglf4JLDdgNMb9rET1dkgtKE6
dOaJHPGjf1uvnOH4YwkQr7n4sLUR3Kdbh0ZJAFuQVDZulo+LLzxBBkqJJcB6FhF+
oXCdHTKZnqAhpWDz+NXYytAmevab6IYm5TWPWsJUv1YKJA5lg2mXbbloIZlN9Mgc
i9fi03bdw+crAgMBAAEWB3Rlc3RpbmcwDQYJKoZIhvcNAQEEBQADggEBALyUvP/o
pPSoWBlorFyZ2RnGwKf9qMpE0q2IJP7G3oDR4LyK/m933DUiZ+YnqThrH/CWb4Ek
y5I3OCyl3S4wCuU1ibZZwDVwYShr5ELp0J9PEf7qMQZOhNsizoC7k+Czb2xB6hYW
sKfsfTKm3cXBtH3fdgc/Z1Z7VSWnAzYo38snqm72NTf5yFRnrQdphNNXi+kn1zHA
lxXRyFDXHOcYsOnwAWfyXFA4QDHQ0ezz0UoCY8gJXovcZb4GRYqOLUAsF2HcNboy
29WN8VqE29sL9QxVZFlwMcqyoLcNnyw38GvNvAGqSvzzbnEFP2MAQXJVe0H0hdp/
MML5G2iNVgNozAo=
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>openssl_spki_verify</function></member>
<member><function>openssl_spki_export_challenge</function></member>
<member><function>openssl_spki_export</function></member>
<member><function>openssl_get_md_methods</function></member>
<member><function>openssl_csr_new</function></member>
<member><function>openssl_csr_sign</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->