PHP 8.5.0 Alpha 4 available for testing

Voting

: eight plus one?
(Example: nine)

The Note You're Voting On

reg1barclay at REMOVETHIS dot live dot it
6 years ago
To verify a .p7m file with openssl_pkcs7_verify() you must convert it to S/MIME format. For example...
<?php
function der2smime($file)
{
$to=<<<TXT
MIME-Version: 1.0
Content-Disposition: attachment; filename="smime.p7m"
Content-Type: application/x-pkcs7-mime; smime-type=signed-data; name="smime.p7m"
Content-Transfer-Encoding: base64
\n
TXT;
$from=file_get_contents($file);
$to.=chunk_split(base64_encode($from));
return
file_put_contents($file,$to);
}
?>

<< Back to user notes page

To Top