You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Pradipkumar Ahire <pr...@cashcare.in> on 2016/02/08 13:02:29 UTC

How to check document password

Hi,

I am working on Encrypted PDFs.
While using *isEncrypted()* returns true when I used  *isUserPassword(password)
*it is giving the result  *password incorrect *always even the its correct.

I tried using *StandardSecurityHandler*'s *isUserPassword() *method.
But I couldn't make it as it required more parameters than password whch
are not available.

Attached is the file I have created. Can you please help me.

Thank you.

-- 



*Thanks and Regards*




*Pradipkumar AhireCashCare TechnologyContact : 9403807201*
*Skype id : ahirepradipkumar*

Re: How to check document password

Posted by Tilman Hausherr <TH...@t-online.de>.
The correct way to do it in 1.8 is

|doc.openProtection(newStandardDecryptionMaterial(password)); to find out 
whether it is the user or the owner password, check the rights after 
decrypting. AccessPermission ap = doc.getCurrentAccessPermission(); if 
(ap.isOwnerPermission()) { // owner password } |



Am 08.02.2016 um 13:02 schrieb Pradipkumar Ahire:
> Hi,
>
> I am working on Encrypted PDFs.
> While using *isEncrypted()* returns true when I used 
> *isUserPassword(password) *it is giving the result *password incorrect 
> *always even the its correct.
>
> I tried using *StandardSecurityHandler*'s *isUserPassword() *method.
> But I couldn't make it as it required more parameters than password 
> whch are not available.
>
> Attached is the file I have created. Can you please help me.
>
> Thank you.
>
> -- 
> *
> *
> *
> *
> *
> *
> *Thanks and Regards*
> *
> *
> **
> *Pradipkumar Ahire
> CashCare Technology
> Contact : 9403807201
> *
> *Skype id : ahirepradipkumar*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org