import org.spongycastle.jce.provider.BouncyCastleProvider;
Security.addProvider(new BouncyCastleProvider());
KeyFactory factory = KeyFactory.getInstance("ESDSA", "BC");
publicKeyServer = (ECPublicKey) factory.generatePublic(new X509EncodedKeySpec(bytePubKeyServer));
This is the code I try to add the bounycastleProvider. The bouncycastle Jar don't work on Android so I saw that I need to use the spongy castle jar. So I have added the spongy castle jar now I am stuck. In this code I try to convert bytes to a public key.
This is the error message
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/spongycastle/util/Strings
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
implementation 'com.madgag.spongycastle:bctls-jdk15on:1.58.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}