问题
This question is the continuation of that one. I also try to communicate with a 3rd party AS2 server. I use the same code as the author of that post. This code (the corrected version) is:
private byte[] Sign(byte[] content)
{
CmsSigner cmsSigner = new CmsSigner(_cert);
cmsSigner.SignedAttributes.Add(new Pkcs9SigningTime(DateTime.Now));
SignedCms signedCms = new SignedCms(new ContentInfo(content));
signedCms.ComputeSignature(cmsSigner, true);
return signedCms.Encode();
}
But I get the following error back from the server:
Unable to verify content integrity: Message digest mismatch in signature.
in spite of signedCms.CheckSignature(false);
doesn't throw an exception.
Where should I search the reason of this error?
来源:https://stackoverflow.com/questions/63017981/c-sharp-add-timestamp-to-pkcs7-cms-digital-signature-problem