我一直在尝试使用默认撤销模式和标记X509RevocationFlag.EntireChain
的自定义X509ChainPolicy验证Xamarin中的X509Chain。在测试过程中,无论链的叶证书(a)是否包含CRL信息,(b)确实包含CRL信息且未被撤销,(c)确实包含CRL信息并被撤销,返回的结果始终为{{1 }}
示例代码:
X509ChainStatusFlags.RevocationStatusUnknown
上述代码将始终在X509Certificate cert = // ...
X509Chain originalChain = // ...
var customChainPolicy = new X509ChainPolicy();
customChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
foreach (var certificate in originalChain.ChainPolicy.ExtraStore)
{
customChainPolicy.ExtraStore.Add(certificate);
}
var certificateChain = new X509Chain();
certificateChain.ChainPolicy = customChainPolicy;
var successful = certificateChain.Build(new X509Certificate2(cert));
中返回X509ChainStatusFlags.RevocationStatusUnknown
。我错过了什么吗?