可以使用phpmailer与s/mime签名,获取“签名错误:”

发布于 2025-01-24 08:55:17 字数 700 浏览 2 评论 0原文

我正在使用phpmailer尝试发送签名的电子邮件(S/MIME)。

我用了 John dalesandro的出色教程 创建一个自签名的S/MIME证书并以PKCS12格式打包。

然后,我遵循 制作 cert.crt,cert.key& certchain.pem 来自我的PKCS12包装。

当我使用下面的代码签名时,我会收到“签名错误:”:

$mail->sign(
  '/mypath/cert.crt', 
  '/mypath/cert.key', 
  'mypassword',
  '/mypath/certchain.pem'
);

当我不尝试签署电子邮件时,电子邮件将正常发送。

由于我的错误代码中根本没有解释,因此我不明白我在做什么错。

I'm using phpmailer to try to send signed emails (S/MIME).

I used this
excellent tutorial by John Dalesandro
to create a Self-Signed S/MIME Certificate and package it in PKCS12 Format.

I then followed the instructions in PHPMailer S/MIME signing
to make cert.crt, cert.key & certchain.pem from my PKCS12 package.

When I sign with the code below I get "Signing Error:" :

$mail->sign(
  '/mypath/cert.crt', 
  '/mypath/cert.key', 
  'mypassword',
  '/mypath/certchain.pem'
);

The emails are sent normally when I don't try to sign the email.

Since there is no explanation at all in my error code, I don't understand what I'm doing wrong.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彼岸花似海 2025-01-31 08:55:17

因此,我从外部证书授权机构中获得了PKCS12的S/MIME证书。然后,我制作了 cert.crt,cert.key& certchain.pem 如上所述,现在起作用。

So I got a S/MIME certificate in PKCS12 from a external certificate authority. I then made a cert.crt, cert.key & certchain.pem as stated above and now it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文