gpt4 book ai didi

email - 如何检查加密的S/MIME消息是否也已签名,而不对其进行解密

转载 作者:行者123 更新时间:2023-12-04 05:07:43 24 4
gpt4 key购买 nike

加密该消息时,最简单的方法(就计算资源而言)是什么来判断是否用附加的签名对s/mime电子邮件消息进行了签名?

如果邮件刚刚签名,这很容易。它有点像:

用于附加签名

   Content-Type: application/x-pkcs7-mime; smime-type=signed-data;
name="smime.p7m"

或者:

用于独立签名
   Content-Type: multipart/signed; protocol="application/x-pkcs7-signature";
micalg=SHA1; boundary="----=_NextPart_000_00D2_01CD5850.61030BF0"

在其标题中。

但是,当邮件被加密时,您无法确定它是否也已签名,因为两种情况下的Content-Type header 都是相同的(只是加密和加密/签名):
  Content-Type: application/x-pkcs7-mime;
smime-type=enveloped-data;
boundary="----=_NextPart_000_000D_01CDC82B.98454D80";
name="smime.p7m"

这是否意味着我必须解密该消息以告诉它是否也已签名?现在,似乎我什至在解密消息之前都无法确定消息是否已签名(因为签名位于加密数据中)。或者,也许S/MIME加密和签名的数据仍然具有某种模式,可以让我在不解密的情况下区分加密/签名和加密/未签名的数据(如果我没有解密证书,这甚至有可能)吗?

最佳答案

S/MIME是灵活的;您可以以所需的任意组合来签名和/或加密。但是,电子邮件客户端通常都具有相同的行为:Outlook 2010,Apple的Mail和Thunderbird 17都进行签名然后加密。这3个的结果几乎相同。它们在消息头中包括以下3个头:

Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
name="smime.p7m"
Content-Disposition: attachment; filename="smime.p7m"
Content-Transfer-Encoding: base64

它们对消息的整个主体进行加密和base64编码。

要回答您的问题:

What is the easiest way (in terms of computing resources) to tell if an s/mime email message is signed with attached signature when this message is encrypted?



唯一的方法是解密它。

Does it mean that I have to decrypt the message just to tell if it's also signed?



是的。

关于email - 如何检查加密的S/MIME消息是否也已签名,而不对其进行解密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13512026/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com