Skip to main content
Participant
April 16, 2025
Question

Sign with CryptSignMessage

  • April 16, 2025
  • 2 replies
  • 922 views

Hello. I'm signing a document with CryptSignMessage (C), but when I open the document in Adobe, it tells me it's been modified or corrupted. Any recommendations on where the problem might be?

2 replies

JR Boulay
Community Expert
Community Expert
April 18, 2025

[MOVED TO THE ACROBAT FORUM]

Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
Community Expert
April 16, 2025

I opened the file you posted with out any error messages, other than an invalid signature. What the type and version of Acrobat do you have? 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
April 16, 2025

I have version 2025.001.20435. The document does open, but when validating the signature, it indicates that it has been modified or corrupted. However, I've tried recalculating the SHA256 after adding the signature to the document, and it matches the one created before signing. I don't know what else I should check...

 

AnandSri
Legend
April 18, 2025

Hello!

 

I hope you are doing well, and thanks for reaching out.

 

As highlighted by our community product experts, if you have the source file, try creating the PDF again and adding the signature. If the PDF structure doesn't fully comply with Adobe's expectations for digitally signed documents, you may get the error message.

 

Ensure PDF Signature Compliance: Adobe expects signed PDFs to follow the PDF digital signature specification (as per ISO 32000-1 and ETSI PAdES standards😞

  • Signature must be embedded in a dedicated signature field within an incremental update.

  • The byte range specified in the PDF must exclude the signature value itself.

  • The signature should be DER-encoded and embedded correctly within the /Contents field.

Even if the SHA256 hash matches, if the byte range is incorrect or the document was not signed in a proper incremental save, Acrobat will flag it as modified.

 

Use Adobe's Validation Tools

After signing, use Preflight (in Acrobat Pro) to validate the document structure and confirm that:

  • The signature field is present and well-formed.

  • The document hasn’t been incrementally saved incorrectly.

  • No invisible changes were introduced after signing.

Use Adobe's Validation Tools: After signing, use Preflight (in Acrobat Pro) to validate the document structure and confirm that: The signature field is present and well-formed. The document hasn’t been incrementally saved incorrectly. No invisible changes were introduced after signing.

Ensure that the CSP used for signing is correctly configured and called during the signing process. Refer to this article for more information: https://adobe.ly/4jChpLp

 

Download and install the latest build from the Menu > help > check for updates, restart the machine after installing the updates, and check. 

 

I hope the above information helps.

Thanks,

Anand Sri.