(PHP 4 >= 4.0.6, PHP 5, PHP 7)
openssl_pkcs7_decrypt — 锟斤拷锟斤拷一锟斤拷 S/MIME 锟斤拷锟杰碉拷锟斤拷息
$infilename
, string $outfilename
, mixed $recipcert
[, mixed $recipkey
] ) : bool
使锟斤拷锟斤拷 recipcert
锟斤拷 recipkey
指锟斤拷锟斤拷证锟斤拷锟斤拷锟街拷锟斤拷锟斤拷锟剿皆匡拷锟斤拷锟� infilename
锟侥硷拷锟叫帮拷锟斤拷锟斤拷 S/MIME 锟斤拷锟斤拷锟斤拷息
infilename
outfilename
锟斤拷锟杰碉拷锟斤拷息锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷募锟斤拷校锟斤拷锟�outfilename
锟斤拷锟斤拷锟斤拷
recipcert
recipkey
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 openssl_pkcs7_decrypt() 锟斤拷锟斤拷
<?php
// $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!";
}
?>