问题
This is extended question from : Adding LTV in signature makes pdf invalid using C#
I have signed a file using DSS services of global sign. But that pdf shows different behavior for different laptops and PCs. Some adobe reader even if the LTV is added, It shows LTV not enabled moreover suppose there are 3 certificates in signed doc and showing valid in my adobe but in other person's adobe reader it is only one or two certs middle certificate is missing or only last certificate in present in chain. why Adobe is behaving differently i could not understand.
Unsigned pdf is : https://gofile.io/?c=Hd3tfm - We are adding one image on this using aspose before proceeding for signing. Signed pdf is : https://gofile.io/?c=Gu1kF2
To make it work i have took reference from this similar question and added AdobeLtvEnabling class and extra missing certificates in my code :Trouble making pdf document LTV enabled in C# and iTextSharp
Code is same as my previous question just i removed LTV section and added this new Addition code:
PdfReader reader = new PdfReader(finalsignedPdf);
FileStream os = new FileStream(finaltrustedSignedpdf, FileMode.CreateNew);
PdfStamper pdfStamper = new PdfStamper(reader, os, (char)0, true);
X509Certificate2 extra = new X509Certificate2(@"D:\CertExchange.cer");
AdobeLtvEnabling adobeLtvEnabling = new AdobeLtvEnabling(pdfStamper);
AdobeLtvEnabling.extraCertificates.Add(new Org.BouncyCastle.X509.X509Certificate(X509CertificateStructure.GetInstance(extra.GetRawCertData())));
IOcspClient ocspnw = new OcspClientBouncyCastle();
ICrlClient crl = new CrlClientOnline();
adobeLtvEnabling.enable(ocspnw, crl);
pdfStamper.Close();
but still result is same. This fix worked for one pc in which that extra cert was missing but not for others. Kindly suggest for LTV and certificate both Thanks in advance.
来源:https://stackoverflow.com/questions/58691511/shows-ltv-not-enabled-for-ltv-enabled-documents-certificate-missing-from-hierar