Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2888

setAllSecurityToBeRemoved(true) before calling protect() should have no effect

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Crypto
    • Labels:
      None

      Description

      As discussed on the mailing list:

      user Roberto Nibali had a problem where a file wasn't saved with encryption. The cause turned out to be that he had called

      setAllSecurityToBeRemoved(true)
      

      and then

      protect(...)
      

      Although the javadoc of both methods is clear, I see a risk that this happens again, e.g. when people combine existing code.

      Solution: set allSecurityToBeRemoved to false when protect() is called and log a warning.

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: