问题
I was trying to read a standard password protected Microsoft Excel Worksheet when I get the error:
org.apache.poi.EncryptedDocumentException: Unsupported hash algorithm
I've been following the standard procedure for xlsx files:
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(file));
EncryptionInfo info = new EncryptionInfo(fs); // exception strikes here
Decryptor d = Decryptor.getInstance(info);
What can I do ?
回答1:
The document at http://poi.apache.org/encryption.html describes which encryption formats are support in the current release of Apache POI.
The latest version of Apache POI is actually 3.13, not 3.9. It should be available on Maven as well.
Please try to use the latest version, if your file is encrypted with any of the supported algorithms, it should work.
来源:https://stackoverflow.com/questions/33455441/org-apache-poi-encrypteddocumentexception-unsupported-hash-algorithm