Hi,
Thanks for considering Aspose.Cells and Aspose APIs.
Please check the attached
sample excel file. It’s password is 11. If you have not provided the
bouncy castle i.e. bcprov-jdk16-146.jar, it will throw the following exception. But if you will add this jar in class path, then this exception will not be thrown. Some other exception might be thrown e.g. illegal key size or the code will run successfully.
However, the following exception tells that bouncy castle is missing and Aspose.Cells needs it for some sort of password protected files like those who have AES encryption but some password protected files can work directly in Aspose.Cells without the need of this jar.
I have also attached the
screenshot that explains how to create such an excel file that makes Apose.Cells to require bouncy castle.
Java
LoadOptions opts = new LoadOptions();
opts.setPassword(“11”);
Workbook wb = new Workbook(dirPath + “BouncyPwd-11.xlsx”, opts);
Exception
Exception in thread “main” java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
at com.aspose.cells.zub.a(Unknown Source)
at com.aspose.cells.zub.a(Unknown Source)
at com.aspose.cells.zti.a(Unknown Source)
at com.aspose.cells.zcam.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at ClsAspose.f1(ClsAspose.java:34)
at ClsAspose.main(ClsAspose.java:15)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 7 more