Free Support Forum - aspose.com

Add LTV to digitally signed pdf

We have digitally signed pdf signed from a key hardwarekey of having X509 digital signing certificate, how to add LTV-Long term validation to same is there any method or set of method available at Aspose.

@cyginfo

Regretfully, the LTV support is not yet available in the API. However, a feature request as PDFNET-47925 has already been logged in our issue tracking system for the implementation. The ticket is currently under the phase of investigation and we will surely inform you as soon as it is resolved and feature is available. Please be patient and spare us some time.

We are sorry for the inconvenience.

as work from home continues for longer period, more and more customers seem to ask for Digital Signature and LTV(Long term validation)…

@asad.ali, Can we vote this feature?

@maulikCE

We have logged your concerns and will surely consider them in order to escalate the ticket implementation. Please note that the priority of this ticket is already high due to increased demand. However, this is a new feature as well and requires certain amount of time to get fully investigated and impelmented. We will inform you as soon as we have some additional updates in this regard. Please spare us some time.

We are sorry for the inconvenience.

@asad.ali, As two business weeks has gone by, eager to know the outcome of your investigation.

@maulikCE

We would like to share with you that priority of this feature request is already at its maximum level and its already on our roadmap. However, the feature needs more time for implementation. We will try to make it available in this year and will surely update you as soon as we have additional updates in this regard. We greatly appreciate your patience in this matter.

Has any progress been made on this feature? We are in the process of evaluating different PDF SDKs. LTV is an absolute must for us.

@rwinningham

We have added LTV support in 20.12 version of the API. However, the ticket is not yet completely resolved as secure timestamping feature is yet to be implemented. As soon as the ticket is resolved, we will update this forum thread.

string outputFile = @"c:\ltvEnabled.pdf";
using (Document document = new Document(@"c:\helloWorld.pdf"))
{
      PdfFileSignature signature = new PdfFileSignature(document);
      PKCS7 pkcs7 = new PKCS7(@"c:\test.pfx", "1234");
      pkcs7.UseLtv = true;
      signature.Sign(1, true, new System.Drawing.Rectangle(100, 100, 300, 300), pkcs7);
      signature.Save(outputFile);
}

using (Document document = new Document(outputFile))
{
      PdfFileSignature signature = new PdfFileSignature(document);
      Assert.IsTrue(signature.IsLtvEnabled);
}

We tried setting useLTV = true but the pdf file is not LTV enabled after signature.

@sigma

Would you please share how you are verifying the LTV validation? Are you using the Signature.IsLtvEnabled property to check it or some other way? Please share your sample PDF document with us so that we can test the scenario in our environment and address it accordingly.

.IsLtvEnabled is true on that document. But Adobe Reader tells it is not. see screenshot attached.
image.png (7.0 KB)

@sigma

Would you please try to share your sample source and output PDF document with us along with certificate. We will test the scenario in our environment and address it accordingly.

Here is the code I use. I can share the PDF but I cannot share the certificate as it is a production certificate.NonWorking.pdf (127.1 KB)
a.pdf (29.2 KB)

using (Document document = new Document(“c:\temp\a.pdf”))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{

                System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);


                PKCS7 a = new PKCS7("c:\\temp\\test.p12", "xxxxxxx");
                a.UseLtv = true;
                
                
                signature.Sign(1, "Signature Reason", "Contact", "Location", true, rect, a);

                signature.Save("c:\\temp\\NonWorking.pdf");

                using (Document doc = new Document("c:\\temp\\NonWorking.pdf"))
                {
                    PdfFileSignature aa = new PdfFileSignature(doc);
                    bool ltvenabled = aa.IsLtvEnabled; // is true here but Adobe is telling it is not.
                    return;
                }
            }
        }

@sigma

Thanks for sharing the requested information.

We have logged an issue as PDFNET-49265 in our issue tracking system for the sake of further investigation. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.