I able to sign the document using iText 5, but text in the visible signature I want to add after hash generation, can anyone help me out with this. If i am adding layer2text before hash generation it works file.
Asked
Active
Viewed 52 times
1 Answers
1
This is not possible.
An integrated pdf signature, at least an interoperable one, covers its whole revision except merely the hex encoded byte string containing the CMS signature container (or the PKCS#1 signature for one sub filter). See this answer for details.
Thus, it in particular covers the text in the visible signature. So that text is part of the hashed data and cannot be changed after hash generation.
A probable work-around
The pdf standard offers a mechanism to change contents even of signed pdfs without breaking the hash: incremental updates. So if the signature allows enough changes, you can change the signature appearance in an incremental update to the signed pdf. See this answer for details.