PDF Signature always returning as invalid

Hi,

I’m having trouble understanding and getting the PDF signature code to work as expected.

I use PdfFileSignature, bind the document and get the SigNames

Then using the SigNames collection I call VerifySigned(SigNames[i]). But it’s always false

Looking at samplecertifiedpdf.pdf (56.7 KB)

Adobe shows it as Valid:

image.png (6.3 KB)

Am I doing something wrong?

@GaryO
Thank you for contacting support.
We are checking it and will get back to you shortly.

@GaryO
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54956

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you @sergey.mikhaylov,

Can you provide an example of code to read the validity of the signatures of a PDF signed document (and a sample PDF that will work with it)?

@GaryO
Yes, of course
free267545.pdf (1.6 MB)

        using (var signature = new PdfFileSignature())
        {
            signature.BindPdf(signedFile);

            foreach (var name in signature.GetSignNames())
            {
                Console.WriteLine("name:" + name + " State:" +signature.VerifySigned(name));
            }
        }

Thank you. The code does work with your example PDF.

Is there only certain types of signings Aspose.PDF can verify? Is there a way to determine if the signature is actually invalid vs Aspose just couldn’t verify?

I’ve tested the code on a number of PDFs from various sources and the only one that seems to work is your example PDF.

@GaryO
This is a specific topic.
I will add your question to the PDFNET-54956 task and they will conduct additional research when considering the task.