Skip to content

Commit fda2c96

Browse files
committed
Add openssl_cipher_key_length description
1 parent bc0556b commit fda2c96

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<refentry xml:id="function.openssl-cipher-key-length" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<refnamediv>
4+
<refname>v</refname>
5+
<refpurpose>Gets the cipher key length</refpurpose>
6+
</refnamediv>
7+
8+
<refsect1 role="description">
9+
&reftitle.description;
10+
<methodsynopsis>
11+
<type class="union"><type>int</type><type>false</type></type><methodname>openssl_cipher_key_length</methodname>
12+
<methodparam><type>string</type><parameter>cipher_algo</parameter></methodparam>
13+
</methodsynopsis>
14+
<para>
15+
Gets the cipher key length.
16+
</para>
17+
</refsect1>
18+
19+
<refsect1 role="parameters">
20+
&reftitle.parameters;
21+
<variablelist>
22+
<varlistentry>
23+
<term><parameter>cipher_algo</parameter></term>
24+
<listitem>
25+
<para>
26+
The cipher method, see <function>openssl_get_cipher_methods</function> for a list of potential values.
27+
</para>
28+
</listitem>
29+
</varlistentry>
30+
</variablelist>
31+
</refsect1>
32+
33+
<refsect1 role="returnvalues">
34+
&reftitle.returnvalues;
35+
<para>
36+
Returns the cipher length on success, &return.falseforfailure;.
37+
</para>
38+
</refsect1>
39+
40+
<refsect1 role="errors">
41+
&reftitle.errors;
42+
<para>
43+
Emits an <constant>E_WARNING</constant> level error when the cipher algorithm
44+
is unknown.
45+
</para>
46+
</refsect1>
47+
48+
<refsect1 role="examples">
49+
&reftitle.examples;
50+
<example>
51+
<title><function>openssl_cipher_key_length</function> example</title>
52+
<programlisting role="php">
53+
<![CDATA[
54+
<?php
55+
$method = 'AES-128-CBC';
56+
57+
var_dump(openssl_cipher_key_length($method));
58+
?>
59+
]]>
60+
</programlisting>
61+
&example.outputs.similar;
62+
<screen>
63+
<![CDATA[
64+
int(16)
65+
]]>
66+
</screen>
67+
</example>
68+
</refsect1>
69+
70+
</refentry>
71+
<!-- Keep this comment at the end of the file
72+
Local variables:
73+
mode: sgml
74+
sgml-omittag:t
75+
sgml-shorttag:t
76+
sgml-minimize-attributes:nil
77+
sgml-always-quote-attributes:t
78+
sgml-indent-step:1
79+
sgml-indent-data:t
80+
indent-tabs-mode:nil
81+
sgml-parent-document:nil
82+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
83+
sgml-exposed-tags:nil
84+
sgml-local-catalogs:nil
85+
sgml-local-ecat-files:nil
86+
End:
87+
vim600: syn=xml fen fdm=syntax fdl=2 si
88+
vim: et tw=78 syn=sgml
89+
vi: ts=1 sw=1
90+
-->

reference/openssl/versions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
-->
66
<versions>
77
<function name="openssl_cipher_iv_length" from="PHP 5 &gt;= 5.3.3, PHP 7, PHP 8"/>
8+
<function name="openssl_cipher_key_length" from="PHP 8 &gt;= 8.2.0"/>
89
<function name="openssl_cms_decrypt" from="PHP 8"/>
910
<function name="openssl_cms_encrypt" from="PHP 8"/>
1011
<function name="openssl_cms_read" from="PHP 8"/>

0 commit comments

Comments
 (0)