How to Fix Adobe Acrobat BER Decoding Errors in PDF Timestamps
Question details
The user needs to resolve a BER decoding error in Adobe Acrobat that occurs when processing a PDF timestamp generated by a custom Python server.

- Product
- Adobe Acrobat / Custom Python Timestamp Server
- Device & OS
- not provided
- Scenario
- Validating a PDF document that was digitally signed and timestamped using a custom Python timestamp server utilizing ECDSA.
- Observed behavior
- Adobe Acrobat fails to process the timestamp and reports a BER decoding error, indicating the timestamp response does not conform to RFC 3161 structure or DER encoding standards.
Extract the raw timestamp token from the problematic PDF document and have an ASN.1 decoder tool ready to inspect the binary structure.
Verify and Fix RFC 3161 Compliance and DER Encoding
Analyze the generated timestamp token to ensure it perfectly matches the standard ASN.1 structure and strictly follows Distinguished Encoding Rules (DER).
Acrobat is highly strict regarding signature formatting. A BER decoding error almost always means the token violates structural encoding requirements, particularly regarding indefinite lengths or missing required attributes.
Use a PDF debugging tool to extract the raw timestamp token from the PDF signature dictionary.
Run the extracted token through an ASN.1 decoder to identify formatting anomalies in the tree structure.
Ensure all lengths are properly and definitively encoded. The payload must strictly follow Distinguished Encoding Rules (DER), not just Basic Encoding Rules (BER).
Confirm that the ECDSA signature format, message imprint, nonce, and the complete certificate chain are present and accurately conform to RFC 3161 guidelines in your Python server logic.

Compare with a Known Working Token
Use a valid timestamp token from a trusted Certificate Authority (CA) as a baseline to spot missing attributes in your custom token.
View and Manage PDFs Securely with WPS PDF
Avoid complex backend decoding errors by using the built-in, compliant digital signature and document security features in WPS Office.
- 1. Launch WPS Office: Open the WPS Office suite on your computer and navigate to the PDF module.
- 2. Open the PDF File: Click on 'Open' to load the PDF document that needs to be verified or signed.
- 3. Access the Protect Tab: Navigate to the 'Protect' tab on the top ribbon to view all available document security options.
- 4. Manage Signatures: Select 'Sign Document' to apply a standard-compliant digital signature, or click on existing signatures to securely view their validation status and properties.

Frequently Asked Questions
What does a BER decoding error mean in Adobe Acrobat?
A BER decoding error indicates that Acrobat cannot parse the structure of a digital signature or timestamp because the binary data violates Basic Encoding Rules (BER) or Distinguished Encoding Rules (DER) required by PDF security protocols.
What is RFC 3161?
RFC 3161 is a standard protocol for Time-Stamp Protocol (TSP). It defines the strict structures required to request and respond with digital timestamps, ensuring a document's integrity over time is universally verifiable.
Can I fix a timestamp decoding error without changing my server code?
No. If the error stems from a custom Python timestamp server generating structurally invalid tokens, the server's serialization logic must be corrected to produce strict DER-encoded RFC 3161 tokens.
Why does ECDSA cause issues with custom timestamp servers?
ECDSA signatures require specific formatting for parameters like the R and S values in the ASN.1 sequence. If these values are incorrectly padded or structured in your Python script, strict PDF readers will reject the token.




