[转]cxf开发webservice生成数字安全证书

分别生成服务端:serverStore.jks,clientStore.jks 
1.创建一个私钥放入keystore里 
keytool -genkey -alias apmclient -keypass apmclientpass  -keystore clientStore.jks - 

storepass keystorePass  -dname "cn=nowwell" -keyalg RSA  
2.进行签名 

keytool -selfcert -alias apmclient  -keystore clientStore.jks -storepass keystorePass 

-keypass apmclientpass 

3.导入私钥到key.rsa 
keytool -export -alias apmclient  -file key.rsa -keystore clientStore.jks  -storepass 

keystorePass 

4.导入公钥到新的keystore中 
keytool -import -alias apmserver -file key.rsa -keystore serverStore.jks -storepass 

keystorePass  -keypass apmserverpass 

客户端配置文件: 
outsecurity_sign.properties 
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 
org.apache.ws.security.crypto.merlin.keystore.type=jks 
org.apache.ws.security.crypto.merlin.keystore.password=keystorePass 
#org.apache.ws.security.crypto.merlin.alias.password=apmclientpass 
org.apache.ws.security.crypto.merlin.keystore.alias=apmclient 
org.apache.ws.security.crypto.merlin.file=clientStore.jks 

服务端配置文件: 
server_insecurity_sign.properties 
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 
org.apache.ws.security.crypto.merlin.keystore.type=jks 
org.apache.ws.security.crypto.merlin.keystore.password=keystorePass 
#org.apache.ws.security.crypto.merlin.alias.password=keypass 
org.apache.ws.security.crypto.merlin.keystore.alias=apmserver 
org.apache.ws.security.crypto.merlin.file=serverStore.jks 

你可能感兴趣的:(webservice)