`
wmk123456789
  • 浏览: 10040 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

An unsupported signature or encryption algorithm was used

 
阅读更多

An unsupported signature or encryption algorithm was used  

 

服务端异常内容:
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: 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)
org.codehaus.xfire.fault.XFireFault: 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)

 

背景:
spring + xfire + wss4j ,为soap请求加密,客户端请求时发生。

环境:
jdk1.5; windowsXP

特别要注意这个服务运行jdk环境,我搞了好久还是会出现以上异常,后面慢慢想想,什么地方出现问题,原来我们配置了系统jdk(方法就是解决方法),而如果是weblogic服务器,运行的时候利用的是weblogic自带的jdk,没有配置相关下面信息,因此在weblogic老是出现以上异常,如果用系统的jdk,如tomcat则不会出现以上异常

问题原因:
系统环境中默认的jre的JCE(Java Cryptography Extension)是受限的,应把它替换成不受限的版本。

解决方法:

  1. 下载bcprov-jdk15-1.44.jar包置于%JRE_HOME%/lib/ext目录下。
  2. 下载jce_policy-1_5_0.zip,把解压得到的US_export_policy.jar和local_policy.jar两个jar包置于%JRE_HOME%/lib/security目录下。(替换原来的)
  3. 修改%JRE_HOME%/lib/security/java.security文件,新增配置:security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider。
  4. 把bcprov-jdk15-1.44.jar导入工程。

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics