We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Regarding bouncy castle jar usage

Is bcprov-jdk16 jar required for using aspose-cells.jar ? We want to use bcprov-jdk15on jar along with aspose-cells. So can we replace bcprov-jdk16 with bcprov-jdk15on jar [http://www.bouncycastle.org/download/bcpg-jdk15on-154.jar] ??

Thanks !!

Hi,

Thanks for your posting and using Aspose.Cells.

Yes, this file is required by Aspose.Cells for certain operations like encrypting/decrypting excel files.

We have logged your question in our database for product team investigation. It will look into it and let you know that if you can downgrade bouncy castle jar from jdk16 to jdk15. Once there is some news for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41795 - Downgrading bouncy castle jar from jdk16 to jdk15

Hi,


Thanks for your query.

Well, the JAR file “bcprov-jdk16-146.jar” is actually needed for AES encryption only supported by MS Excel 2010. So, if you do not encrypt the Workbooks or do not use this feature in your project, you may exclude it.

Thank you.

Hi again,


This is to update you that we have performed tests using the jdk15on.jar and it works fine. However, we still suggest you to use the latest version.

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