org.apache.poi.EncryptedDocumentException: Unsupported hash algorithm

﹥>﹥吖頭↗ 提交于 2019-12-31 06:49:59

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!