import org.spongycastle.jce.provider.BouncyCastleProvider;
Security.addProvider(new BouncyCastleProvider());
KeyFactory factory = KeyFactory.getInstance("ESDSA", "BC");
publicKeyServer = (ECPublicKey) factory.generatePublic(new X509EncodedKeySpec(bytePubKeyServer));
这是我试图添加bounycastleprovider的代码。bouncycastlejar在android上不工作,所以我看到我需要使用海绵状castlejar。所以我加了海绵城堡罐现在我卡住了。在这段代码中,我尝试将字节转换为公钥。
这是错误消息
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
}
暂无答案!
目前还没有任何答案,快来回答吧!