mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 13:58:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
72 lines
2.4 KiB
XML
72 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- splitted from ./en/functions/openssl.xml, last change in rev 1.4 -->
|
|
<refentry id="function.openssl-pkcs7-decrypt">
|
|
<refnamediv>
|
|
<refname>openssl_pkcs7_decrypt</refname>
|
|
<refpurpose>Decrypts an S/MIME encrypted message</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>openssl_pkcs7_decrypt</methodname>
|
|
<methodparam><type>string</type><parameter>infilename</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>outfilename</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>recipcert</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>recipkey</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
Decrypts the S/MIME encrypted message contained in the file specified by
|
|
<parameter>infilename</parameter> using the certificate and it's
|
|
associated private key specified by <parameter>recipcert</parameter> and
|
|
<parameter>recipkey</parameter>.
|
|
</para>
|
|
<para>The decrypted message is output to the
|
|
file specified by <parameter>outfilename</parameter>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>openssl_pkcs7_decrypt</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
// $cert and $key are assumed to contain your personal certificate and private
|
|
// key pair, and that you are the recipient of an S/MIME message
|
|
$infilename = "encrypted.msg"; // this file holds your encrypted message
|
|
$outfilename = "decrypted.msg"; // make sure you can write to this file
|
|
|
|
if (openssl_pkcs7_decrypt($infilename, $outfilename, $cert, $key))
|
|
echo "decrypted!";
|
|
else
|
|
echo "failed to decrypt!";
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<para>This function was added in 4.0.6.</para>
|
|
</note>
|
|
|
|
</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:"../../../../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
|
|
-->
|