org.apache.poi.EncryptedDocumentException:不支持的哈希算法 [英] org.apache.poi.EncryptedDocumentException: Unsupported hash algorithm
问题描述
出现错误时,我试图读取受密码保护的标准Microsoft Excel工作表:
I was trying to read a standard password protected Microsoft Excel Worksheet when I get the error:
org.apache.poi.EncryptedDocumentException: Unsupported hash algorithm
我一直在遵循xlsx文件的标准程序:
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);
我该怎么办?
推荐答案
位于 http://poi的文档.apache.org/encryption.html 描述了当前版本的Apache POI支持的加密格式.
The document at http://poi.apache.org/encryption.html describes which encryption formats are support in the current release of Apache POI.
Apache POI的最新版本实际上是3.13,而不是3.9.它也应该在Maven上可用.
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.
这篇关于org.apache.poi.EncryptedDocumentException:不支持的哈希算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!