Hi Zachary,

I am forwarding to you an answer to a similar question about  HSSF Password 
support.

> -I can set a write password on an HSSFWorkBook.
> How may I set a read password on an HSSFWorkBook?

The answer to the first is likely no and the second question is probably yes. 
You'll need to give it a try.

Regards,
Dave

Begin forwarded message:

> From: Josh Micich <[email protected]>
> Date: May 3, 2010 4:30:59 PM PDT
> To: David Fisher <[email protected]>
> Cc: Jacob Feldman <[email protected]>, [email protected]
> Subject: Re: how POI reads encrypted workbooks
> 
> Hello Jacob,
> 
> I remember working on 47652 and I'm pretty sure HSSFWorkbook also
> utilises the new functionality (not just ExcelExtractor).  It might
> have been better to include a test case using HSSFWorkbook to make
> this clearer.
> 
> Biff8EncryptionKey.setCurrentUserPassword("password");
> InputStream is = HSSFTestDataSamples.openSampleFileStream("password.xls");
> HSSFWorkbook wb = new HSSFWorkbook(is);
> 
> I haven't tried this code, but I believe it should work.
> 
> Functionality is not yet complete but as far as I understand POI
> supports reading, modifying and writing back of encrypted workbooks.
> Biff8EncryptionKey uses a ThreadLocal, so it *is* threadsafe.
> 
> Some notable things not yet implemented:
>  - Creating encrypted workbooks
>  - Removing encryption from an existing workbook
>  - Adding encryption to an existing workbook
>  - Changing the encryption password
> 
> It shouldn't be too difficult to add these in though.  Most of the
> leg-work was in getting the BIFF record encoding right.
> 
> Note - this functionality is all BIFF8 (Excel 95-2003) specific.
> Encryption is handled very differently in the OOXML version of the
> file spec.  I'm not sure if POI has any encryption support on the
> OOXML side yet.
> 
> regards,
> Josh


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to