Android Studio project with Box Java SDK - Bouncycastle fails to decrypt private key
I am developing an Android app in Android Studio which needs to access shared Box folders and get the URL's for files with direct download links within those folders.
The latest Box Java SDK builds successfully in Android Studio (latest version) using Android API level 27.
I intend to use the SDK to obtain access tokens to make https GET calls from the application.
I generated a config.json credential file using the Box Developers console and incorporated the file into my project.
Using an example provided in the SDK examples folder, I built a stub into the project which reads the config.json file and attempts to generate access tokens.
The application throws an exception like this:
com.box.sdk.BoxAPIException: Error parsing PKCS private key for Box Developer Edition. ......extraneous lines removed..... Caused by: org.bouncycastle.pkcs.PKCSException: unable to read encrypted data: 1.2.840.113549.1.5.13 not available: Provider BC does not provide 1.2.840.113549.3.7
There is a warning in the SDK Readme that the JCE package from Oracle needs to be added to the JRE, otherwise exceptions may be thrown, but I can find no documentation on how this might apply to Android Studio.
Any hints appreciated - I am blocked on this unless I can figure out an alternative to retrieve the file download links.
Please sign in to leave a comment.
Comments
0 comments