[ 
https://issues.apache.org/jira/browse/PDFBOX-2460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14187171#comment-14187171
 ] 

Tilman Hausherr commented on PDFBOX-2460:
-----------------------------------------

@Ralf Hauser, thanks for your input in this matter. I have committed your 
"verbose" patch with slight changes. The code is useful if we ever have 
problems in the future.

Re the test file, I've only done a "minimal" change, i.e. put back the 
exception that was deleted. This was probably done accidentally, without seeing 
that it was in a test where we wanted to fail.

Re the two tests that didn't work:
The access permissions are correct in prepareForDecryption(), but later no 
more, because a default "free for all" permission object is given. The problem 
is getting the permissions into PDDocument. This was a bit "complicated" and 
didn't work. getCurrentAccessPermission() doesn't work after decrypt, even 
getSecurityHandler() no longer works. My solution is to get the permissions 
immediately and to keep them in PDDocument.

And the best:
The test is now enabled.

> fix TestPublicKeyEncryption.java
> --------------------------------
>
>                 Key: PDFBOX-2460
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2460
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.0
>         Environment: java7 , deb7
>            Reporter: Ralf Hauser
>            Assignee: Tilman Hausherr
>         Attachments: patch2460Decryption.txt, patch2460DecryptionVerbose.txt, 
> patch2460PublicKeyTestCaseOnError.txt
>
>
> as reported by Tilman in PDFBOX-2456



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to