首页 > 解决方案 > 使用 openssl 签署多部分/混合电子邮件

问题描述

我目前正在尝试使用以下命令使用 openssl cms 签署电子邮件:

openssl cms -sign -in unsigned_message -out signed_message -certfile ca_certs.pem -signer client_cert.pem -from xxx@yyy.com -to yyy@zzz.com -subject sample_subject

如果 unsigned_message 是这样构建的(没有多部分邮件),那么一切正常并且签名是正确的:

Content-Type: text/html

<div>test</div>

但是,如果电子邮件包含这样的多部分消息:

Content-Type: multipart/mixed;boundary="sample_boundary"

--sample_boundary
Content-Type: text/html

<div>test</div>

--sample_boundary
Content-type: text/plain; charset=us-ascii 

test

--sample_boundary--

电子邮件的签名错误。但我不知道为什么?

标签: emailopensslmultipart

解决方案


推荐阅读