求助 java SSL Sockets~~~~
各位大侠小弟有个问题想请教一下之前我有两个 .keystore 文件 返回SSLSocketFactory~~
代码:
KeyStore ks = null;
KeyStore ts = null;
tmf = TrustManagerFactory.getInstance("SunX509");
kmf = KeyManagerFactory.getInstance("SunX509");
ks = KeyStore.getInstance("JKS");
ts = KeyStore.getInstance("JKS");
ks.load(new FileInputStream("1.keystore"), ksPass.toCharArray());
ts.load(new FileInputStream("2.keystore"), tsPass.toCharArray());
kmf.init(ks, ksPass.toCharArray());
tmf.init(ts);
String secRandomAlgorithm = "SHA1PRNG";
SecureRandom secRandom = SecureRandom.getInstance(secRandomAlgorithm);
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), secRandom);
factory = (SSLSocketFactory)ctx.getSocketFactory();
现在我就有一个.pfx文件 想返回SSLSocketFactory 代码该怎么写
小弟跪求~~~