【发布时间】:2012-03-08 18:54:12
【问题描述】:
我正在尝试发送 S/Mime 签名和加密的电子邮件。
我有这个代码:
// Sign the message first
openssl_pkcs7_sign("inc/admin/email/body.txt","inc/admin/email/body/enc.txt",
"signing_cert.pem",array("private_key.pem",
"test"),array());
// Get the public key certificate.
$pubkey = file_get_contents("cert.pem");
//encrypt the message, now put in the headers.
openssl_pkcs7_encrypt("signed.txt", "enc.txt", $pubkey,$headers,0,1);
我的问题是哪个证书是哪个?如果我使用我拥有的证书(可以吗),我拥有的文件是:
- .key
- .csr
- .crt
- 和公共 .pem。
哪个是哪个?
【问题讨论】: