这是我的代码
static void Main(string[] args)
{
try
{
ContentInfo contentInfo = new ContentInfo(File.ReadAllBytes(@"D:\prj\temp\manifest.json"));
SignedCms signedCms = new SignedCms(SubjectIdentifierType.IssuerAndSerialNumber, contentInfo);
var signer = new CmsSigner(new X509Certificate2(@"D:\prj\temp\Shooger_Passbook_withoutKey.p12", "xxxxxxxxx"));
signer.Certificates.Add(new X509Certificate2(@"D:\prj\temp\AppleIncRootCertificate.cer"));
signer.Certificates.Add(new X509Certificate2(@"D:\prj\temp\AppleWWDRCA.cer"));
signer.IncludeOption = X509IncludeOption.WholeChain;
signer.SignedAttributes.Add(new Pkcs9SigningTime());
signedCms.ComputeSignature(signer, false);
byte[] myCmsMessage = signedCms.Encode();
File.WriteAllBytes(@"D:\prj\temp\signature", myCmsMessage);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
有人能告诉我为什么它会抛出“发生内部证书链接错误。”吗?