0

I have a pdf which is restricted on Signing permission.

Signning : Not Allowed

I try to use pdfbox AccessPermission to check the edit permission before signing it. But in the source code of AccessPermission, i did not find the corresponding access permission, either from API doc AccessPermission API

Is there any work around approach in pdfbox to check the 'Signing' permission attribute.

Cœur
  • 37,241
  • 25
  • 195
  • 267
ryuukei
  • 23
  • 8
  • The Document Restriction Summary summarizes document restrictions due to different causes. Restrictions introduced with encryption (the *AccessPermission API* you mention are only one source of restrictions and don't treat signatures specially, they there are covered by form-field-filling. Another source are digital signature transformations. And yet another is the viewing program itself: you'll often get different permissions in Adobe Acrobat and Adobe Acrobat Reader. – mkl Nov 21 '16 at 13:47
  • @mkl thanks! OK, i see, the AccessPermission is mainly for forms editing permission. What do you mean by 'digital signature transformations'? – ryuukei Nov 21 '16 at 13:59
  • *"What do you mean by 'digital signature transformations'?"* - Cf. the PDF specification [ISO 32000-1](http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf) section 12.8.2 - Transform Methods. – mkl Nov 21 '16 at 14:03
  • @mkl ah, hmm. I want to implement kind of 'preflight' function to check whether an input pdf contains all necessary attributes, whether the pdf is allowed to be signed (as my question). So that i won't add 'invalid' signature (acrobat reader does not parse it correctly) without decrypting the pdf properly with correct password first. – ryuukei Nov 21 '16 at 14:21
  • In that case it is most important to properly check existing signatures. In particular you should check if there is certification signature (i.e. a signature that contains a DocMDP transform method), cf. [stackoverflow documentation on PDF](http://stackoverflow.com/documentation/pdf/5161/integrated-pdf-signatures/18524/allowed-and-disallowed-changes-to-a-signed-document#t=201611220745326847399). Another factor to take into account are seed values, cf. section 12.7.4.5 - Signature Fields - in the PDF specification. And you should heed the lock dictionary explained in the same section. – mkl Nov 22 '16 at 07:49
  • For more details see [this answer](https://stackoverflow.com/a/65021738/1729265). – mkl Nov 26 '20 at 12:06

0 Answers0