-
Notifications
You must be signed in to change notification settings - Fork 70
/
openssl-spki-new.xml
173 lines (162 loc) · 5.96 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
169
170
171
172
173
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 5bc68add3da3cd18c40f851e944b15095d3a26aa Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<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>Создаёт подписанный открытый ключ с вызовом</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>openssl_spki_new</methodname>
<methodparam><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>
Функция через заданный алгоритм хеширования создаёт подписанный открытый ключ с вызовом.
</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.
</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>
Функция возвращает подписанный открытый ключ со строкой вызова или &false;,
если возникла ошибка.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Функция выдаёт ошибку уровня <constant>E_WARNING</constant>, если
в параметре <parameter>digest_algo</parameter> указали некорректный алгоритм.
</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>;
раньше принимался ресурс (&resource;) с типом <literal>OpenSSL key</literal>.
</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>
Создаёт новый SPKAC-ключ с алгоритмом по умолчанию (MD5)
</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 не удалась";
}
?>
]]>
</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
-->