Hi,'

I have a requirement of writing data to xlsx encrypted(protected file with
password) file and I have used the following code snippet from apache to do
the same
POIFSFileSystem fs = new POIFSFileSystem();
EncryptionInfo info = new EncryptionInfo(fs, EncryptionMode.agile);
// EncryptionInfo info = new EncryptionInfo(fs, EncryptionMode.agile,
CipherAlgorithm.aes192, HashAlgorithm.sha384, -1, -1, null);

Encryptor enc = info.getEncryptor();
enc.confirmPassword("foobaa");

OPCPackage opc = OPCPackage.open(new File("..."), PackageAccess.READ_WRITE);
OutputStream os = enc.getDataStream(fs);
opc.save(os);
opc.close();

FileOutputStream fos = new FileOutputStream("...");
fs.writeFilesystem(fos);
fos.close();   

I got the error at EncryptionInfo class for EncryptionMode.agile. Iam using
POI3.9. Could anyone please help



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Encrypt-xlsx-file-with-POI3-9-tp5716609.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to