我们正在尝试使用 MimeKit 来验证数字签名的电子邮件 (.p7m) 签名。当我调用signature.Verify();
它时,它会抛出错误消息:
{"验证数字签名失败:需要非空集\r\n参数名称:值"}。
但同一封邮件已被 Limilabs.Mail 成功验证。
我正在使用下面的代码来验证签名。
if (message.Body is MultipartSigned)
{
var signed = (MultipartSigned)message.Body;
foreach (var signature in signed.Verify())
{
try
{
bool valid = signature.Verify();
// If valid is true, then it signifies that the signed content
// has not been modified since this particular signer signed the
// content.
// However, if it is false, then it indicates that the signed
// content has been modified.
}
catch (DigitalSignatureVerifyException)
{
// There was an error verifying the signature.
}
}
}
任何人都可以帮助我解决为什么我会收到错误吗?