I am facing the problem with my digital signature verification when I am applying password to the file from java code.
In my scenario I am getting the file which is already having a digital signature.
I want to put password on pdf file which is digital signed.
I am able to put the password but the concern is that now the digital signature is not verified.
Suggest me some way how we can achieve it.
Is it possible to have it?
Please let me know if any more clarification required from my side….
You cannot put a password on a PDF previously signed without breaking the signature. A signature checks whether the signed data is unchanged as a stream of bytes. A password changes those bytes. Thus, the signature will break if a password does applied afterwards.
You might consider signing and encrypting at the same time.
If that is not possible in your case, you might consider adding the signed PDF to a PDF portfolio and encrypting that portfolio. In that case the signed PDF would have to be opened from the portfolio which implies decrypting it.
PS I assumed in all of the above that you meant regular PDF signatures, not XFA signatures.