Tag: bouncycastle spongycastle

比较java中的PublicKey对象

我有两个PublicKey对象。我想比较两者的相等性或使用java安全API或弹性城堡API检查哪个是最新的对象。我怎么能实现这个目的?

使用SSL与Bouncy Castle进行Android到服务器通信

我知道这不是那么困难,但非常不幸的是我从昨天起就被困在这里并与之斗争,我在Android教程中遵循了这种相互认证 ,将密钥库置于资源中并尝试通过SSL连接到我的服务器,但是得到以下exception java.lang.RuntimeException:org.spongycastle.jcajce.provider.asymmetric.x509.CertificateFactory $ ExCertificateException 我已将sslapptruststore.pfx文件放在res/raw/sslapptruststore.pfx并使用这段代码 try { KeyStore clientCert = KeyStore.getInstance(“PKCS12”); clientCert.load(getResources().openRawResource(R.raw.sslapptruststore), “123456”.toCharArray());// this line causes exception HttpClient httpClient = null; HttpParams httpParams = new BasicHttpParams(); SSLSocketFactory sslSocketFactory = new SSLSocketFactory(clientCert, null, null); SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme(“https”, sslSocketFactory, 8443)); httpClient = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, registry), httpParams); HttpPost httpPost = new HttpPost( […]