File tree Expand file tree Collapse file tree 1 file changed +44
-4
lines changed
reference/openssl/functions Expand file tree Collapse file tree 1 file changed +44
-4
lines changed Original file line number Diff line number Diff line change 10
10
&reftitle.description;
11
11
<methodsynopsis >
12
12
<type >bool</type ><methodname >openssl_pkcs7_read</methodname >
13
- <methodparam ><type >string</type ><parameter >input_filename </parameter ></methodparam >
13
+ <methodparam ><type >string</type ><parameter >data </parameter ></methodparam >
14
14
<methodparam ><type >array</type ><parameter role =" reference" >certificates</parameter ></methodparam >
15
15
</methodsynopsis >
16
16
<para >
25
25
&reftitle.parameters;
26
26
<variablelist >
27
27
<varlistentry >
28
- <term ><parameter >input_filename </parameter ></term >
28
+ <term ><parameter >data </parameter ></term >
29
29
<listitem >
30
30
<para >
31
-
31
+ The string of data you wish to parse (p7b format).
32
32
</para >
33
33
</listitem >
34
34
</varlistentry >
35
35
<varlistentry >
36
36
<term ><parameter >certificates</parameter ></term >
37
37
<listitem >
38
38
<para >
39
-
39
+ The array of PEM certificates from the p7b input data.
40
40
</para >
41
41
</listitem >
42
42
</varlistentry >
50
50
</para >
51
51
</refsect1 >
52
52
53
+ <refsect1 role =" examples" >
54
+ &reftitle.examples;
55
+ <para >
56
+ <example >
57
+ <title >Get a PEM array from a P7B file</title >
58
+ <programlisting role =" php" >
59
+ <![CDATA[
60
+ <?php
61
+
62
+ $file = 'certs.p7b';
63
+
64
+ $f = file_get_contents($file);
65
+ $p7 = array();
66
+ $r = openssl_pkcs7_read($f, $p7);
67
+
68
+ if ($r === false) {
69
+ printf("ERROR: %s is not a proper p7b file".PHP_EOL, $file);
70
+ for($e = openssl_error_string(), $i = 0; $e; $e = openssl_error_string(), $i++)
71
+ printf("SSL l%d: %s".PHP_EOL, $i, $e);
72
+ exit(1);
73
+ }
74
+
75
+ print_r($p7);
76
+ ?>
77
+ ]]>
78
+ </programlisting >
79
+ </example >
80
+
81
+ </para >
82
+ </refsect1 >
83
+
84
+ <refsect1 role =" seealso" >
85
+ &reftitle.seealso;
86
+ <para >
87
+ <simplelist >
88
+ <member ><function >openssl_csr_sign</function ></member >
89
+ </simplelist >
90
+ </para >
91
+ </refsect1 >
92
+
53
93
54
94
</refentry >
55
95
<!-- Keep this comment at the end of the file
You can’t perform that action at this time.
0 commit comments