I use the PDF library to validate signature. The code I'm using is basic.
List<PdfSignatureValidationResult> results;
isSignatureValid = form.Fields.ValidateSignatures(out results);
I've tested a lot of PDF file and it works fine. In few specific PDF files, the 'ValidateSignatures' takes about 15 seconds.
I tried also to disable validate revocation
isSignatureValid = form.Fields.ValidateSignatures(
new PdfSignatureValidationOptions { ValidateRevocationStatus = false},
out results);
Is there a way to find out what takes so long with the problematic PDF files?
Query: Is there a way to find out what takes so long with the problematic PDF files?
As you have mentioned, the specific exception occurs with a few specific PDF files. We need to analyze the pdf structure programmatically and to check whether the reported issue occurs with the signature or the specific pdf document. Can you provide a confidential dummy signed document that caused the specific exception you mentioned, so we can investigate the issue and assist you further in this?
Attached a file that has the problem. The verify operation takes 15 seconds.
Please investigate what can it be.
Thank you for sharing the details. We are internally validating the certificate revocation
details using web request. The customer provided document signed certificate
has both the OCSP and CRL details. we are internally trying to verify the OCSP
and CRL data. the time taken is based on the network speed [it may
vary on network speed]. This is the reason to validating the certificates take
some amount of time.
we have the option to omit the Certificate Revocation List (CRL), and Online Certificate Status Protocol (OCSP) while signing the PDF document and validating the signature from the PDF document in our library.
using (var loadedDocument = new PdfLoadedDocument("../../Empty.pdf")) {
var signature = new PdfSignature( loadedDocument, loadedDocument.Pages[loadedDocument.Pages.Count - 1], certificate,"Signature");
signature.LocationInfo = " "; signature.Reason = " "; signature.EnableLtv = false;
signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill | PdfCertificationFlags.AllowComments | PdfCertificationFlags.ForbidChanges; signature.SignedName = "Syncfusion"; loadedDocument.Save("../../Signed.pdf");
} |
For signature validation, we requested you to disable the ValidateRevocationStatus property while validating a signature.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("../../Signed.pdf");
PdfSignatureValidationOptions validationOptions = new PdfSignatureValidationOptions(); validationOptions.ValidateRevocationStatus = false;
List<PdfSignatureValidationResult> results; if(loadedDocument.Form!=null && loadedDocument.Form.Fields.Count>0) loadedDocument.Form.Fields.ValidateSignatures(validationOptions, out results);
//Close the document
loadedDocument.Close(true); |
Please refer to the below UG documentation about LTV,
Hi Irfana ,
The pdf that I have sent you has not been signed with Syncfusion, I only run the ValidateSignatures on it.
I already disabled ValidateRevocationStatus and it does not help.
I am still facing the same problem, the method
ValidateSignatures() takes 15 seconds with this specific PDF.
We have checked the reported issue with the provided details on our end and it was working properly. We have included a sample and a video demonstrating the steps we took to replicate the issue.
sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ConsoleSample453210260
We request you check this and confirm whether you are following the same steps or not. If still you are facing the issue,
Please share with us the following details to check the issue from our side,
So, that we can assist you further with this
https://www.syncfusion.com/downloads/support/directtrac/general/ze/ConsoleSample453210260
I checked with your source code and on my computer I get the extra 15 seconds.
Regarding you questions:
We have created a new ticket under your account to follow up on this query. We suggest you follow up with the ticket for further updates. Please log in using the below link.
https://support.syncfusion.com/support