1

我正在尝试使用 c# 对要在 Passbook 中使用的清单文件进行签名。在他们发布 iOS6 的 GM 之前,我的代码运行良好。在这个种子中,他们希望签名包含中间证书。这是我的代码:

var dataToSign = System.IO.File.ReadAllBytes(filePathToSign);
ContentInfo contentInfo = new ContentInfo(new Oid("1.2.840.113549.1.7.2"), dataToSign);

var signerCert = new X509Certificate2(signerPfxCertPath, signerPfxCertPassword);

var signedCms = new SignedCms(contentInfo, true);

var signer = new CmsSigner(signerCert);
signer.IncludeOption = X509IncludeOption.ExcludeRoot;

signedCms.ComputeSignature(signer);

var myCmsMessage = signedCms.Encode();

return myCmsMessage;

我在我的机器上安装了证书,但它不起作用。任何想法我错过了什么?

4

1 回答 1

0

正如评论中提到的(感谢Rudi):

Blockquote 看这里这里

于 2012-10-17T20:24:03.773 回答