https://bz.apache.org/bugzilla/show_bug.cgi?id=62811
Bug ID: 62811
Summary: POI Encryption didn't work with 4.0.0 but did work
with 3.17
Product: POI
Version: 4.0.0-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: POI Overall
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 36193
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36193&action=edit
Example of file produced.
Using the code from https://poi.apache.org/encryption.html
POIFSFileSystem fs = new POIFSFileSystem();
EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile);
// EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile,
CipherAlgorithm.aes192, HashAlgorithm.sha384, -1, -1, null);
Encryptor enc = info.getEncryptor();
enc.confirmPassword("foobaa");
// Read in an existing OOXML file
OPCPackage opc = OPCPackage.open(new File("..."), PackageAccess.READ_WRITE);
OutputStream os = enc.getDataStream(fs);
opc.save(os);
opc.close();
// Write out the encrypted version
FileOutputStream fos = new FileOutputStream("...");
fs.writeFilesystem(fos);
fos.close();
This works fine with 3.17 but doesn't work with 4.0.0. It just creates a 2k
file that Microsoft Excel won't open.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]