Sign a signed-PDF with it's hash value
I have to do the followingto an existing PDF document, programatically using PDFBox::
1. Open the existing document (as a PDDocument object)
1. Create a Signature object.
2. Set the Name, Location, Reason and SignDate properties.
3. Add the Signature to tee document.
4. Save as Signed PDF docuument.
5. Get the Hash value of the Signed PDF document.
6. Sign the Signed PDF docuument.with the Hash value.
All works fine except when I open in Acrobat, T get the error 'At least one signature is invalid''. If I expaind the errror, I get:
- Signature is invalid.
- Document has been altered or corrupted since last it was signed.
- Signer's identity is valid.
- Signin ttime is from the clock ...
The signatures are validd if I do (6) above using thee contents of the Signed PDF instead on iit's Hasd value.
Wham am I doing wrong?
Is 'Signing' the document using a Hash value supported?
Many thanks in advance.
