downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

openssl_pkcs7_encrypt> <openssl_pkcs12_read
Last updated: Fri, 13 Nov 2009

view this page in

openssl_pkcs7_decrypt

(PHP 4 >= 4.0.6, PHP 5)

openssl_pkcs7_decryptS/MIME 暗号化されたメッセージを復号する

説明

bool openssl_pkcs7_decrypt ( string $infilename , string $outfilename , mixed $recipcert [, mixed $recipkey ] )

infilename で指定したファイル中の S/MIME 暗号化されたメッセージを、recipcert および recipkey で指定した証明書と公開鍵を用いて復号します。

パラメータ

infilename

outfilename

復号したメッセージは、outfilename で指定したファイルに出力されます。

recipcert

recipkey

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 openssl_pkcs7_decrypt() の例

<?php
// $cert および $key にはあなたの個人証明書と公開鍵が含まれており、
// あなたはS/MIMEメッセージの受信者であると仮定します。
$infilename "encrypted.msg";  // 暗号化されたメッセージを含むファイル
$outfilename "decrypted.msg"// このファイルへの書き込み権限が必要

if (openssl_pkcs7_decrypt($infilename$outfilename$cert$key)) {
    echo 
"復号しました!";
} else {
    echo 
"復号に失敗しました!";
}
?>



add a note add a note User Contributed Notes
openssl_pkcs7_decrypt
There are no user contributed notes for this page.

openssl_pkcs7_encrypt> <openssl_pkcs12_read
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites