Hi Andreas
I want to say that POI works perfect for Excel 2003-2010.
I can check Sheet protection for excel 2003-2010
For xls files:
short protectionPassword = hssfSheet.getpassword();
For xlsx files: (until 2013)
byte[] password =
xssfSheet.getCTWorksheet().getSheetProtection().getPassword();
short protectionPassword = java.nio.ByteBuffer.wrap(password).getShort()
To generate password I use:
short hashPassword = PasswordRecord.hashPassword("password");
if (hashPassword == protectionPassword) // this is OK.
But in excel 2013 look in sheet-xml similar to
<sheetProtection algorithmName="SHA-512"
hashValue="5MANCkOK6IY02H1LhiJ+ucR5ZHvoV7BwbINSx52iIhe4Xfg986k2l32ONsYpt8JPiy8U8kqPRKXIr7G8hfMWOw=="
saltValue="R040EdN/Ec7il6MJ8JrRLQ==" spinCount="100000" sheet="1"
objects="1" scenarios="1"/>
So I'm interesting in how can I check password correction.
Excel2013SheetProtection.xlsx
<http://apache-poi.1045710.n5.nabble.com/file/n5714827/Excel2013SheetProtection.xlsx>
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Problem-POI-3-9-with-extracting-hashValue-and-saltValue-from-excel-2013-protected-worksheet-tp5714790p5714827.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]