Hi,
I ma doing the following steps one by one please let me know where I am doing wrong.
I want to sign and encrypt an existing PDF document.
Here are the steps I follow.
1. I open the document in PDF reader.
2. I creat a new PDFwriter.
3. Do the copy of pages, Bookmars. and then add the signarue field to the PDF document
4. Close the PDF document and store as on temparary file.
5. Open this temporary file . compute the signature using Bouncy Castle.
6. Get the signed data.
7. Add the signed date to the content field of Signature PDF object.
8. Manipulate the byte range and close the file.
9. Now againa opne this temporary file using reader.
10. Pass thru the encrytor and stream it back as the final file.
But when I open the file in the acrobat reader, It adds a new page to the pdf document.
And then the document version is shown as 1 of 2, which means the document has been tampered with .
I suspect that the encryption is adding some bytes and hence the byte range that we specified during signing process got offset.
SO should we recalculate the byte range again and modify it after encrypting the file. Does this work? Is this the correct procedure./
Any hep would be appreciated.
Thanks
Shashi
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
