PDF change detection using signatures

I am developing a web application that allows users to upload a PDF file that they must sign using Adobe Acrobat, using their certificate, and then upload it back to the Internet.

I use C#and itextsharp 5.5.9.0for all works related to PDF.

Now I need to check that the document was not changed after it was downloaded from the Internet. I tried to do this by adding my own signature to the PDF file before allowing users to download it (the signature is implemented more or less like this question ). Signing and verification work fine until the file is signed a second time (with a user certificate).

After that, the first signature somehow becomes invalid, I checked both methods itextsharp AcroFields.SignatureCoversWholeDocument(it returns false) in Adobe Acrobat UI ( screenshot ).

So, I have 2 questions:

  • Is it possible to check if a document has been changed between two signatures?
  • If not, what is the alternative way to programmatically (using itextsharp) check whether the PDF file was modified after it was created and before it was signed?
+4
source share
1 answer

Signing and verification work fine until the file is signed a second time (with a user certificate). After that, the first signature somehow becomes invalid

, , , (iText lingo)/ ( PDF). , , , .

  • , ?

, , , , .

: , API- iText . :

, ,

  • , ;
  • PDF, ;
  • , ;
  • ;
  • ;
  • , , .

, , .

, , . ...

Adobe Acrobat

: Adobe Acrobat , , , Adobe Acrobat .

, , .

  1. - ( itextsharp) , PDF ?

, , , PDF , . .

, , . , . PDF, , , .

iText, , .


: , " " , , Adobe Acrobat , .


PDF " ".

+4

Source: https://habr.com/ru/post/1649931/


All Articles