openssl_pkcs7_decrypt

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

openssl_pkcs7_decrypt锟斤拷锟斤拷一锟斤拷 S/MIME 锟斤拷锟杰碉拷锟斤拷息

说锟斤拷

openssl_pkcs7_decrypt ( string $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!";
}
?>