标题:求助 java SSL Sockets~~~~
只看楼主
小枣
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-21
 问题点数:0 回复次数:0 
求助 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 代码该怎么写

小弟跪求~~~
搜索更多相关主题的帖子: Sockets java SSL 
2009-12-23 15:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-294137-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.668494 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved