Closed SimoneTinella closed 2 years ago
Yes, but the SpongyCastleUtils class is never called, and the two methods that cause the exception are only present in BouncyCastleUtilis. It would be correct to implement an interface to be extended in the two utility classes and provide a provider, but I consider it excessive for a legacy project.
Do you have example code that shows the case where you got the error?
I use the following code to create a cert:
This is a snippet of PrivKey.java from opc-ua-stack
This is a snippet of PrivKey.java from opc-ua-stack too
The save method of PrivKey use BC by default, no provider is used and this cause exception on Android platform. The BouncyCastle Utils and SpongyCastle Utils classes are very similar to each other, but no common interface is implemented, furthermore the shared methods are not called from anywhere else within opc-ua-stack and the only method used is writeToPem which is part of BouncyCastleUtilis.
Sorry Simone, this has been pending for a long time. The stack is not actively maintained anymore, but I will apply your commit now, since it is completely valid.
The RuntimeException happened when signing certificates on Android. This error was caused by the hard-coded BC provider on BouncyCastleUtilis class
Updated version to 1.4.1.1-SNAPSHOT