Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Feb 28, 2024 4:43 pm

Hello

How can I set to enable "LTV" Offline Verification ?

The timestamp server was configured - see below:

Code: Select all
 ...
 signature.DistinguishedNameLabel = "DN: ";
 signature.DistinguishedName = signature.Certificate.IssuerName.Name;
               

 // configure a timestamp server url rfc3161
 string url = "http://timestamp.digicert.com";
 signature.ConfigureTimestamp(url);

...

kivgotha
 
Posts: 3
Joined: Tue Feb 13, 2024 2:14 pm

Thu Feb 29, 2024 7:05 am

Hello,

Thank you for your inquiry.
Based on your description, I have conducted preliminary testing on your code. However, I noticed that the signature fields in the resulting file have been enabled with "LTV," as depicted in the screenshot. I utilized the Spire.PDF Pack (Hot Fix) Version: 10.2.2 for my testing. Could you confirm if you are also using this version in your implementation? If not, I recommend upgrading to this version before conducting further tests. I have sent the testing code and resulting file to you via email for your review.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Sep 11, 2024 5:11 pm

I am using Spire.PDF 10.8.1 and adding the code above does not enable LTV on signatures for me. Below is the code I'm using to create a PdfSignature:

Code: Select all
       
        PdfCertificate cert = new PdfCertificate(certificatePath, certificatePassword);
        var signature = new PdfSignature(doc, doc.Pages[0], cert, Constants.DOCUMENT_SIGNING_CERTIFCATE_SIGNATURE_NAME);

        signature.DistinguishedNameLabel = "DN: ";
        signature.DistinguishedName = signature.Certificate.IssuerName.Name;

        string url = @"https://freetsa.org/tsr";
        signature.ConfigureTimestamp(url);

        signature.Certificated = true;
        signature.DocumentPermissions = PdfCertificationFlags.ForbidChanges;

jperkinsSC
 
Posts: 95
Joined: Thu Oct 30, 2014 10:01 pm

Thu Sep 12, 2024 6:21 am

Hello,jperkinsSC

Thanks for your inquiry.
I used your code to sign the PDF document, and the result shows that everything is normal (LTV is enabled). You can try adding 'signature.ConfigureHttpOCSP(null, null)' at the location marked in the screenshot below. Finally, if the problem still persists, you can provide us with your certificate (include password) that can reproduce your problem to help us investigate in detail. You can send it to us via email( support@e-iceblue.com ). Thank you in advance.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 277
Joined: Mon Jul 15, 2024 5:40 am

Thu Sep 12, 2024 4:52 pm

I'm still getting the same result after adding the line of code you suggested. I can't share the PFX file and password as they are being used in production. However, I can share a sample PDF that was created as a result of my code. I hope that helps. Also, do you have any specific documentation or tutorials other than this thread that describes enabling LTV? I haven't been successful in finding any other information than this.

jperkinsSC
 
Posts: 95
Joined: Thu Oct 30, 2014 10:01 pm

Fri Sep 13, 2024 10:07 am

Hello,

Thanks for your feedback.
It is true that LTV has not been enabled in your document. What is the situation after signing your certificate directly using the PDF reading tool, such as Adobe? Below is my complete test code, attached is my test result document. You can use this code to test your certificate and let me know your test results.
Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"test.pdf");
// Get the first page
PdfPageBase page = doc.Pages[0];
// Load a certificate .pfx file
String pfxPath = @"bbb.pfx";
PdfCertificate cer = new PdfCertificate(pfxPath, "****");
// Add a signature to the specified position
Spire.Pdf.Security.PdfSignature signature = new Spire.Pdf.Security.PdfSignature(doc, page, cer, "signature");
signature.Bounds = new RectangleF(new PointF(90, 550), new SizeF(180, 90));
// Set the signature content
signature.NameLabel = "Digitally signed by: Gary";
signature.LocationInfoLabel = "Location:";
signature.LocationInfo = "CN";
signature.ReasonLabel = "Reason: ";
signature.Reason = "Ensure authenticity";
signature.ContactInfoLabel = "Contact Number: ";
signature.ContactInfo = "028-81705109";
signature.DocumentPermissions = PdfCertificationFlags.ForbidChanges;
signature.Certificated = true;
signature.ConfigureTimestamp("https://freetsa.org/tsr");
signature.ConfigureHttpOCSP(null, null);
// Save the PDF file
string outputFile = @"result.pdf";
doc.SaveToFile(outputFile, Spire.Pdf.FileFormat.PDF);

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 277
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.PDF

cron