延伸AdobeLtvEnabling
异常的原因是,对于一个证书,关联的 CRL 是 base64 编码的,AdobeLtvEnabling
类不期望(这里的期望是检索二进制版本,不需要解码)。
您可以延长AdobeLtvEnabling
如下也能够处理 base64 编码的 CRL:搜索AdobeLtvEnabling
method addLtvForChain
并替换 CRL 处理循环
Console.WriteLine(" with {0} CRLs\n", crl.Count);
foreach (byte[] crlBytes in crl)
{
validationData.crls.Add(crlBytes);
addLtvForChain(null, ocspClient, crlClient, getCrlHashKey(crlBytes));
}
有了这个:
Console.WriteLine(" with {0} CRLs\n", crl.Count);
foreach (byte[] crlBytes in crl)
{
PdfName hashKey = null;
byte[] bytes = null;
try
{
hashKey = getCrlHashKey(crlBytes);
bytes = crlBytes;
}
catch (Exception e)
{
Console.WriteLine(" CRL decoding exception, assuming Base64 encoding, trying to decode - {0}\n", e.Message);
bytes = Convert.FromBase64String(new String(Encoding.Default.GetChars(crlBytes)));
hashKey = getCrlHashKey(bytes);
}
validationData.crls.Add(bytes);
addLtvForChain(null, ocspClient, crlClient, hashKey);
}
不过你的签名
虽然相关其他非根证书的撤销现在指的是嵌入式 CRL,但对于一个证书而言,仍然存在问题,Adobe Reader 中的“SafeScrypt sub-CA for RCAI Class 2 2014 (SAFESCRYPTONLINE_15)”的撤销选项卡显示
CRL processing error
Issuer: cn=SafeScrypt CA 2014, houseIdentifier=II Floor, Tidel Park, street=No.4, Rajiv Gandhi Salai, Taramani, Chennai, st=Tamil Nadu, postalCode=600 113, ou=Certifying Authority, o=Sify Technologies Limited, c=IN
This update: 20180303183000Z
Next update: 20190303182959Z
CRL has expired or is not yet valid
事实上,下次更新值为 20190303182959Z 的 CRL 已过期,因此,如果没有适当的 POE,现在无法用于验证。因此,事实上,Adobe Reader 完全正确地指出,根据 CRL(当前由 PKI 提供),它无法确定非撤销。
但可以从其他信息中得知吗?那么,OCSP 响应程序的证书中有一个 AIA 属性,可以替代使用。但尝试使用它失败了,http://ocsp.safescrypt.com http://ocsp.safescrypt.com目前不接受任何请求。所以这不是实际的替代方案。
总而言之,这使得该 CA 的服务质量显得值得怀疑。如果这种状态持续存在,您可能需要切换到其他 CA。