For SSLServer :- System.setProperty("javax.net.ssl.keyStore","server.jks"); System.setProperty("javax.net.ssl.keyStorePassword", "123456"); For SSLClient :- System.setProperty("javax.net.ssl.trustStore","client.jks"); System.setProperty("javax.net.ssl.trustStorePassword", "123456"); ------------------------------------
普通的SSL: (1)导出server的证书 (2)导入到client的trustStore中,使用keytool -import命令 (3)告诉JVM这个trustStore在哪 System.setProperty("javax.net.ssl.trustStore", "C:\\Program Files\\Java\\jre6\\bin\\truststore.jks"); (4)应该就行了。
带签名文件的话,不会,大概是用cxf的WS-SecurityPolicy吧。 写一堆配置,然后请求时会根据签名文件生成一堆Head,然后就行了。 参考: https://cxf.apache.org/docs/ws-securitypolicy.html https://sites.google.com/site/ddmwsst/ws-security-impl
|