`
卡其色秋天
  • 浏览: 33576 次
  • 性别: Icon_minigender_1
  • 来自: 南京
文章分类
社区版块
存档分类
最新评论

关于rampart encrypt的问题

阅读更多

在配了Encypt后,客户端发起调用会报一个错:

org.apache.axis2.AxisFault: WSHandler: Encryption: error during message processingorg.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used (unsupported key transport encryption algorithm: No such algorithm: http://www.w3.org/2001/04/xmlenc#rsa-1_5)

 

一开始以为是因为没找到这个什么RSA的加密算法,后来换别的算法似乎也不行。上网找了一下是因为某些国家对加密算法有一定限制,所以SUN公司在发布JDK的时候里面的策略文件是限制版的。需要到SUN公司网站上下载非限制版的策略文件进行替换。

 

以下是网上找的解决方案:

The problem comes from Java Cryptography Extension (JCE) policy files

1.-
Due to import control restrictions for some countries, the Java Cryptography Extension (JCE) policy files shipped with the J2SE Development
Kit and the J2SE Runtime Environment allow strong but limited cryptography to be used. These files are located at

<java-home>/lib/security/local_policy.jar
<java-home>/lib/security/US_export_policy.jar
where <java-home> is the jre directory of the JDK or the top-level directory of the J2SE Runtime Environment.
An unlimited strength version of these files indicating no restrictions on cryptographic strengths is available
on the JDK web site for those living in eligible countries. Those living in eligible countries may download the unlimited strength
version and replace the strong cryptography jar files with the unlimited strength files.

Unlimited strength Jurisdiction Policy Files may be downloaded from the JavaSoft's web site.
Here is the web address: http://java.sun.com/javase/downloads/index.jsp#docs (At the end of the page).(我已经下载了,放到附件里了。如果需要最新的可以到上面网址下下载)

Open the readme.txt and follow the instructions:
Basically replace two existing jar for the two new ones ((US_export_policy.jar and local_policy.jar )

2.-
Install the Bouncycastle JAR in the Path of the server Web application (WEB-INF/jar/bcprov- jdk15-132.jar).
because if WSS4J does not find the Bouncycastle in the Path it is not
initialized and registered as security provider. and the default one
Sun Security provider does not support all required algorithms and keystore formats.
(in this case RSA)

[Am not so sure about this step. I think all this happends more in the JRE, but as my config work I add it here as comment. see next point]

3.-
I've installed the bouncycastle jar in <jre_home>/lib/ext and i've
changed <jre_home>/lib/security/java.security to add this line:

security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider


4.-
and ... in the client side i don't have to install "unlimited strength
jce", only with the bouncy castle .jar in classpath is enough to run
well.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics