【问题标题】:Include intermediate certificate in signature C#在签名 C# 中包含中间证书
【发布时间】:2012-09-07 19:50:07
【问题描述】:

我正在尝试使用 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;

我在我的机器上安装了证书,但它不起作用。有什么我想念的想法吗?

【问题讨论】:

标签: c# ssh x509certificate2 smime passbook


【解决方案1】:

如 cmets 所述(感谢 Rudi):

块引用看看herehere

【讨论】:

    猜你喜欢
    • 2012-10-29
    • 1970-01-01
    • 2015-01-08
    • 1970-01-01
    • 2014-09-02
    • 2023-04-02
    • 2012-08-30
    • 2012-05-26
    • 2021-08-23
    相关资源
    最近更新 更多