reference/openssl/functions/openssl-csr-export-to-file.xml
497c40ac164d5873fd87f622dfdeb5206392b446
...
...
@@ -1,23 +1,24 @@
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-to-file">
3
+
<refentry xml:id="function.openssl-csr-export-to-file" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>openssl_csr_export_to_file</refname>
6
-
<refpurpose>Exports a CSR to a file</refpurpose>
6
+
<refpurpose>Exports a <acronym>CSR</acronym> to a file</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_to_file</methodname>
13
-
<methodparam><type>resource</type><parameter>csr</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>outfilename</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>output_filename</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_to_file</function> takes the Certificate
19
19
Signing Request represented by <parameter>csr</parameter> and saves it
20
-
as ascii-armoured text into the file named by <parameter>outfilename</parameter>.
20
+
in <acronym>PEM</acronym> format into the file named by
21
+
<parameter>output_filename</parameter>.
21
22
</para>
22
23
</refsect1>
23
24

...
...
@@ -25,15 +26,9 @@
25
26
&reftitle.parameters;
26
27
<para>
27
28
<variablelist>
29
+
&openssl.param.csr;
28
30
<varlistentry>
29
-
<term><parameter>csr</parameter></term>
30
-
<listitem>
31
-
<para>
32
-
</para>
33
-
</listitem>
34
-
</varlistentry>
35
-
<varlistentry>
36
-
<term><parameter>outfilename</parameter></term>
31
+
<term><parameter>output_filename</parameter></term>
37
32
<listitem>
38
33
<para>
39
34
Path to the output file.
...
...
@@ -41,7 +36,7 @@
41
36
</listitem>
42
37
</varlistentry>
43
38
<varlistentry>
44
-
<term><parameter>notext</parameter></term>
39
+
<term><parameter>no_text</parameter></term>
45
40
<listitem>
46
41
&note.openssl.param-notext;
47
42
</listitem>
...
...
@@ -57,6 +52,55 @@
57
52
</para>
58
53
</refsect1>
59
54

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

78
+
<refsect1 role="examples">
79
+
&reftitle.examples;
80
+
<para>
81
+
<example>
82
+
<title>openssl_csr_export_to_file() example</title>
83
+
<programlisting role="php">
84
+
<![CDATA[
85
+
<?php
86
+
$subject = array(
87
+
"commonName" => "example.com",
88
+
);
89
+
$private_key = openssl_pkey_new(array(
90
+
"private_key_bits" => 2048,
91
+
"private_key_type" => OPENSSL_KEYTYPE_RSA,
92
+
));
93
+
$csr = openssl_csr_new($subject, $private_key, array('digest_alg' => 'sha384') );
94
+
openssl_pkey_export_to_file($private_key, 'example-priv.key');
95
+
// Along with the subject, the CSR contains the public key corresponding to the private key
96
+
openssl_csr_export_to_file($csr, 'example-csr.pem');
97
+
?>
98
+
]]>
99
+
</programlisting>
100
+
</example>
101
+
</para>
102
+
</refsect1>
103
+

60
104
<refsect1 role="seealso">
61
105
&reftitle.seealso;
62
106
<para>
...
...
@@ -69,7 +113,6 @@
69
113
</refsect1>
70
114

71
115
</refentry>
72
-

73
116
<!-- Keep this comment at the end of the file
74
117
Local variables:
75
118
mode: sgml
76
119