X.509安全Web服务的Java客户端 [英] Java client for the X.509 secured web-service

查看:131
本文介绍了X.509安全Web服务的Java客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用X.509证书保护的远程Web服务。

我生成了Web服务客户端(使用jax-ws),但是需要配置是否用于证书的使用。 >
我该怎么办?

我想我应该在我当地的可信密钥库中注册证书,他们设置如下:

I have remote web-service which is secured with X.509 certificate.
I generated web-service client stuff (using jax-ws) but need to configure if for the certificate's usage.
How should I proceed?
I guess I should register certificate in my local trusted keystore and them set something like this:

System.setProperty("javax.net.ssl.keyStore", keyStore);
System.setProperty("javax.net.ssl.keyStoreType", "JKS");
System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
System.setProperty("javax.net.ssl.trustStore", trustStore);
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword);

但不清楚哪些数据应作为参数提供。

请帮忙。

谢谢。

But it is not clear which data should be provided as the parameters.
Please do help.
Thanks.

推荐答案

密钥库属性定义了向服务器标识您的证书:

The keystore properties defines the certificate that identifies you to the server:

System.setProperty(javax.net.ssl.keyStore,keyStore);

这是一个带有x509证书的java密钥库。您可以使用tha java program keytool创建它。

This is a java keystore with your x509 certificate. You may create it using tha java program keytool.

System.setProperty(javax.net.ssl.trustStore,trustStore);

这是一个java密钥库,其中包含用于标识网站的证书。这仅用于您的Web服务软件,以确保您真正与正确的网站通信。

This is a java keystore with the certificate(s) that identifies the web site. This is only used by your web service software to ensure that you are really talking to the correct web site.

System.setProperty(javax。 net.ssl.keyStoreType,JKS);
System.setProperty(javax.net.ssl.trustStoreType,JKS);

这只是指定了javax.net.ssl.keyStore和javax.net.ssl.trustStore的格式是java密钥库。

This just specifies that the format of the javax.net.ssl.keyStore and javax.net.ssl.trustStore is java keystore.

System.setProperty(javax。 net.ssl.keyStorePassword,keyStorePassword);
System.setProperty(javax.net.ssl.trustStorePassword,trustStorePassword);

这是使用的密码在创建Java密钥库时加密它。

This is the password that was used to encrypt the java keystore when it was created.

这篇关于X.509安全Web服务的Java客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆