Hi team,
I got error when follow the example to sign with TimestampSettings:
How to digitally sign PDF|Aspose.PDF for Java
And I got the error below:
Caused by: class com.aspose.pdf.internal.l13f.lh: Timestamp token found in failed request.
com.aspose.pdf.internal.l14p.lI.lI(Unknown Source)
com.aspose.pdf.internal.l13f.lu.lI(Unknown Source)
com.aspose.pdf.internal.l12v.l2l.lI(Unknown Source)
com.aspose.pdf.internal.l12v.l1l.lI(Unknown Source)
com.aspose.pdf.internal.l12v.l1l.lI(Unknown Source)
com.aspose.pdf.internal.l12v.l1l.lI(Unknown Source)
com.aspose.pdf.internal.l1u.l2if.lI(Unknown Source)
com.aspose.pdf.internal.l1u.l2if.lI(Unknown Source)
com.aspose.pdf.internal.l1u.l2if.lI(Unknown Source)
com.aspose.pdf.Signature.lI(Unknown Source)
com.aspose.pdf.SignatureField.lI(Unknown Source)
com.aspose.pdf.SignatureField.sign(Unknown Source)
Please help to check!
@WaseemMuthu
The error message “Timestamp token found in failed request” typically indicates an issue with the timestamp server or the credentials being used for the timestamp request. Here are some steps you can take to troubleshoot and resolve this issue:
-
Check Timestamp URL: Ensure that the URL you are using for the timestamp server is correct and accessible. The URL should be in the format https://your_timestamp_server
. Make sure there are no typos or incorrect characters.
-
Credentials: If your timestamp server requires authentication, verify that the username and password are correct. If the server does not require authentication, you can omit the user/password from the TimestampSettings
.
-
Network Issues: Ensure that there are no network issues preventing your application from reaching the timestamp server. You can test the URL in a web browser to see if it is reachable.
-
Server Response: Sometimes, the timestamp server may be down or experiencing issues. You can check the server’s status or try using a different timestamp server to see if the problem persists.
-
Code Example: Here is a basic example of how to set up the timestamp settings in your code:
string pfxFile = "path_to_your_certificate.pfx";
using (Document document = new Document("path_to_your_pdf.pdf"))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{
PKCS7 pkcs = new PKCS7(pfxFile, "pfx_password");
TimestampSettings timestampSettings = new TimestampSettings("https://your_timestamp_server", "user:password"); // Adjust as necessary
pkcs.TimestampSettings = timestampSettings;
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
signature.Sign(1, "Signature Reason", "Contact", "Location", true, rect, pkcs);
signature.Save("output_signed_pdf.pdf");
}
}
Make sure to replace "path_to_your_certificate.pfx"
, "path_to_your_pdf.pdf"
, and the timestamp URL with your actual values.
If you continue to experience issues, consider reaching out to the support team of the timestamp server for further assistance.
We tried with the code in your example, with many timeserver: List of free rfc3161 servers. · GitHub
but they all same response.
@WaseemMuthu
Can you please share your sample files for our reference so that we can test the scenario in our environment and address it accordingly?