poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Grossman <j...@prolifics.com>
Subject Problem opening password-protected Excel2013 file.
Date Thu, 21 Nov 2013 03:33:57 GMT
Hi,

I have a password-protected Excel2013 file that I want to read using POI.  I am aware of Bug
55544:
    https://issues.apache.org/bugzilla/show_bug.cgi?id=55544

Hence, I used the most recent "nightly" build:
    https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/

Here is the code:

    POIFSFileSystem pfs = new POIFSFileSystem(new FileInputStream("C:\\customer\\IQNFiles\\PII_sample.xlsx"));
    EncryptionInfo info = new EncryptionInfo(pfs);
    Decryptor dec = Decryptor.getInstance(info);
    dec.verifyPassword("welcome1");
    XSSFWorkbook wb = new XSSFWorkbook(d.getDataStream(pfs));


This code works on a password-protected Excel2010 file but not on the desired file.  The last
line throws an exception:

Exception in thread "main" java.security.InvalidKeyException: No installed provider supports
this key: (null)

I did some digging and I discovered that the password is not accepted (output is 'false'):

    POIFSFileSystem pfs = new POIFSFileSystem(new FileInputStream("C:\\customer\\IQNFiles\\PII_sample.xlsx"));
    EncryptionInfo info = new EncryptionInfo(pfs);
    Decryptor dec = Decryptor.getInstance(info);
    System.out.println(dec.verifyPassword("welcome1"));
 
I suppose this is what caused the exception, above.

Has anyone else seen this problem before?  Have I done something improper?

Thanks for any guidance.


Jeff
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message