Is this part of code is correct?
- I have given 777 permission to the secrypted.msg file.
- I was unable to decrypt the message.
- Give exact definitions for the parameters passed to the function
- Do we want to store the encrypted message explicitly to the encrypted.msg file?
<?php
echo "Decrypt the message"."<br>";
// this file holds your encrypted message
$infilename = "/var/www/html/testing/encrypt/smime.p7m";
// make sure you can write to this file
$outfilename = "/var/www/html/testing/encrypt/decrypted.msg";
$cert = "/var/www/html/testing/encrypt/sasikumar.crt";
$key = "/var/www/html/testing/encrypt/sasikumar.pfx";
if (openssl_pkcs7_decrypt($infilename, $outfilename, $cert, $key))
{
echo "decrypted!";
}
else
{
echo "failed to decrypt!";
}
fclose($infilename);
fclose($fp);
?>
Regards,
Sasikumar Natarajan