我正在使用类似于标准 openssl_pkcs7_sign() 示例的简单 php 代码在循环中签署许多邮件 http://php.net/manual/en/function.openssl-pkcs7-sign.php
问题是这段代码的 I/O 过于密集。这会读取相同的证书并循环调用 openssl 函数。
我可以每次都读取内存中的证书并用于签名吗
这是脚本的相关部分
<?php
$headers = array( "From: Ram <ram@netcore.co.in>", "Subject" => "Signed mail");
/* All the recipients who will get the mail */
$users = array ( 'ram@netcore.co.in' , 'aa@netcore.co.in','bb@netcore.co.in');
foreach ($users as $rcpt){
$headers['To'] = $rcpt;
openssl_pkcs7_sign($rcpt."infile.txt",
"outfile.txt","file://noPassPrivatePublicKey.pem",
array("file://noPassPrivatePublicKey.pem", ""),
$headers);
/* Now make an smtp connection and send the mail */
send_mail_to_smtp($from,$rcpt,"outfile.txt");
}
?>