Home » » openssl_pkcs7_sign

openssl_pkcs7_sign

Written By 1 on Tuesday, October 2, 2012 | 10:20 AM

bool openssl_pkcs7_sign ( string $infilename , string $outfilename , mixed $signcert , mixed $privkey , array $headers [, int $flags = PKCS7_DETACHED [, string $extracerts ]] )
Sign an S/MIME message
openssl_pkcs7_sign() takes the contents of the file named infilename and signs them using the certificate and its matching private key specified by signcert and privkey parameters.
 
// the message you want to sign so that recipient can be sure it was you that
// sent it
$data = << "joes@example.com", // keyed syntax
"From: HQ ", // indexed syntax
"Subject" => "http://php-tutorial-php.blogspot.com/")
)) {
// message signed - send it!
exec(ini_get("sendmail_path") . " < signed.txt");
}


0 Comment:

Post a Comment