reference/openssl/functions/openssl-csr-export.xml
497c40ac164d5873fd87f622dfdeb5206392b446
...
...
@@ -1,23 +1,23 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.openssl-csr-export">
3
+
<refentry xml:id="function.openssl-csr-export" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>openssl_csr_export</refname>
6
-
<refpurpose>Exports a CSR as a string</refpurpose>
6
+
<refpurpose>Exports a <acronym>CSR</acronym> as a string</refpurpose>
7
7
</refnamediv>
8
8
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>openssl_csr_export</methodname>
13
-
<methodparam><type>resource</type><parameter>csr</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter role="reference">out</parameter></methodparam>
15
-
<methodparam choice="opt"><type>bool</type><parameter>notext</parameter><initializer>true</initializer></methodparam>
13
+
<methodparam><type class="union"><type>OpenSSLCertificateSigningRequest</type><type>string</type></type><parameter>csr</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter role="reference">output</parameter></methodparam>
15
+
<methodparam choice="opt"><type>bool</type><parameter>no_text</parameter><initializer>&true;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
<function>openssl_csr_export</function> takes the Certificate Signing
19
-
Request represented by <parameter>csr</parameter> and stores it as
20
-
ascii-armoured text into <parameter>out</parameter>, which is passed by
19
+
Request represented by <parameter>csr</parameter> and stores it in
20
+
<acronym>PEM</acronym> format in <parameter>output</parameter>, which is passed by
21
21
reference.
22
22
</para>
23
23
</refsect1>
...
...
@@ -26,22 +26,18 @@
26
26
&reftitle.parameters;
27
27
<para>
28
28
<variablelist>
29
+
&openssl.param.csr;
29
30
<varlistentry>
30
-
<term><parameter>csr</parameter></term>
31
+
<term><parameter>output</parameter></term>
31
32
<listitem>
32
33
<para>
34
+
on success, this string will contain the <acronym>PEM</acronym>
35
+
encoded <acronym>CSR</acronym>
33
36
</para>
34
37
</listitem>
35
38
</varlistentry>
36
39
<varlistentry>
37
-
<term><parameter>out</parameter></term>
38
-
<listitem>
39
-
<para>
40
-
</para>
41
-
</listitem>
42
-
</varlistentry>
43
-
<varlistentry>
44
-
<term><parameter>notext</parameter></term>
40
+
<term><parameter>no_text</parameter></term>
45
41
<listitem>
46
42
&note.openssl.param-notext;
47
43
</listitem>
...
...
@@ -57,6 +53,57 @@
57
53
</para>
58
54
</refsect1>
59
55

56
+
<refsect1 role="changelog">
57
+
&reftitle.changelog;
58
+
<informaltable>
59
+
<tgroup cols="2">
60
+
<thead>
61
+
<row>
62
+
<entry>&Version;</entry>
63
+
<entry>&Description;</entry>
64
+
</row>
65
+
</thead>
66
+
<tbody>
67
+
<row>
68
+
<entry>8.0.0</entry>
69
+
<entry>
70
+
<parameter>csr</parameter> accepts an <classname>OpenSSLCertificateSigningRequest</classname> instance now;
71
+
previously, a &resource; of type <literal>OpenSSL X.509 CSR</literal> was accepted.
72
+
</entry>
73
+
</row>
74
+
</tbody>
75
+
</tgroup>
76
+
</informaltable>
77
+
</refsect1>
78
+

79
+
<refsect1 role="examples">
80
+
&reftitle.examples;
81
+
<para>
82
+
<example>
83
+
<title>openssl_csr_export() example</title>
84
+
<programlisting role="php">
85
+
<![CDATA[
86
+
<?php
87
+
$subject = array(
88
+
"commonName" => "example.com",
89
+
);
90
+
$private_key = openssl_pkey_new(array(
91
+
"private_key_bits" => 2048,
92
+
"private_key_type" => OPENSSL_KEYTYPE_RSA,
93
+
));
94
+
$configargs = array(
95
+
'digest_alg' => 'sha256WithRSAEncryption'
96
+
);
97
+
$csr = openssl_csr_new($subject, $private_key, $configargs);
98
+
openssl_csr_export($csr, $csr_string);
99
+
echo $csr_string;
100
+
?>
101
+
]]>
102
+
</programlisting>
103
+
</example>
104
+
</para>
105
+
</refsect1>
106
+

60
107
<refsect1 role="seealso">
61
108
&reftitle.seealso;
62
109
<para>
...
...
@@ -69,7 +116,6 @@
69
116
</refsect1>
70
117

71
118
</refentry>
72
-

73
119
<!-- Keep this comment at the end of the file
74
120
Local variables:
75
121
mode: sgml
76
122