Mina sshd和spongycastle:找不到KeyPairGenerator EC实现

时间:2014-10-20 22:22:59

标签: android sshd mina spongycastle

我尝试使用spongycastle 1.51在Android上使用mina sshd 0.12.0。

我已按照现有说明,使用

注册了Spongycastle
static {
  Security.insertProviderAt( new org.spongycastle.jce.provider.BouncyCastleProvider(), 1);
}

Spongycastle被证实是干净利落地注册并要求算法" EC":

java.security.KeyPairGenerator.getInstance("EC");

工作正常。

当我最终尝试与服务器建立ssh连接时,它失败并显示以下堆栈跟踪:

java.security.NoSuchAlgorithmException: KeyPairGenerator EC implementation not found
    at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:113)
    at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:135)
    at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:153)
    at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:125)
    at org.apache.sshd.common.util.SecurityUtils.getKeyPairGenerator(SecurityUtils.java:157)
    at org.apache.sshd.common.kex.ECDH.<init>(ECDH.java:51)
    at org.apache.sshd.server.kex.ECDHP256.getDH(ECDHP256.java:48)
    at org.apache.sshd.server.kex.AbstractDHGServer.init(AbstractDHGServer.java:68)
    at org.apache.sshd.common.session.AbstractSession.doHandleMessage(AbstractSession.java:359)
    at org.apache.sshd.common.session.AbstractSession.handleMessage(AbstractSession.java:295)
    at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:731)
    at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:277)
    at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54)
    at org.apache.sshd.common.io.mina.MinaService.messageReceived(MinaService.java:107)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:854)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:943)
    at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:535)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:714)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1121)
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
    at java.lang.Thread.run(Thread.java:1019)

我在这里不知所措。 插入的提供程序是否以某种方式线程化本地?

我感谢任何暗示。

0 个答案:

没有答案