XFire

Unsupported key transport encryption algorithm

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.2.5
  • Fix Version/s: 1.2.6
  • Component/s: None
  • Labels:
    None
  • Environment:
    JDK 1.5.11
  • Number of attachments :
    0

Description

Hi,

I'm currently unable to encrypt my response messages using WS-Security.
I followed the instructions as explained here http://xfire.codehaus.org/WS-Security (installed Unlimited Strength Jurisdiction Policy Files and the Bouncy Castle security provider) but always receive the error here :

15594 [http-8080-Processor25] ERROR org.codehaus.xfire.service.binding.PostInvocationHandler - 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)
15594 [http-8080-Processor25] INFO org.codehaus.xfire.handler.DefaultFaultHandler - Fault occurred!
org.apache.ws.security.WSSecurityException: 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)
at org.apache.ws.security.action.EncryptionAction.execute(EncryptionAction.java:64)
at org.apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java:192)
at org.codehaus.xfire.security.wss4j.WSS4JOutHandler.invoke(WSS4JOutHandler.java:154)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)

It really seems that the Bouncy Castle parameter into the java.security file is not taken into account.

Any idea ?
Thanks

Activity

Hide
Tomasz Sztelak added a comment -

Probably you have some problem with BC configuration, but to make sure can you post config file where you specify algorithm ?

Show
Tomasz Sztelak added a comment - Probably you have some problem with BC configuration, but to make sure can you post config file where you specify algorithm ?
Hide
Gilles Delaby added a comment -

security properties file :
-------------------------------
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=gilles
org.apache.ws.security.crypto.merlin.keystore.alias=gilles
org.apache.ws.security.crypto.merlin.file=serverStore.jks

java.security :
------------------
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.sun.security.sasl.Provider
security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider

services.xml:
------------------
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>AccessService</name>
<namespace>http://test.com/AccessService</namespace>
<serviceClass>com.test.services.access.IAccessService</serviceClass>
<implementationClass>com.test.services.access.AccessService</implementationClass>
<inHandlers>
<handler handlerClass="com.test.services.handler.ValidateUserTokenHandler"/>
<handler handlerClass="org.codehaus.xfire.util.dom.DOMInHandler"/>
<bean class="org.codehaus.xfire.security.wss4j.WSS4JInHandler" xmlns="">
<property name="properties">
<props>
<prop key="action">UsernameToken</prop>
<prop key="passwordCallbackClass">com.test.services.handler.ServerPasswordHandler</prop>
</props>
</property>
</bean>
</inHandlers>
<outHandlers>
<handler handlerClass="org.codehaus.xfire.util.dom.DOMOutHandler" />
<bean class="org.codehaus.xfire.security.wss4j.WSS4JOutHandler" xmlns="">
<property name="properties">
<props>
<prop key="action">Encrypt</prop>
<prop key="encryptionPropFile">server_outsecurity_enc.properties</prop>
<prop key="passwordCallbackClass">com.test.services.handler.ServerPasswordHandlerOut</prop>
</props>
</property>
</bean>
</outHandlers>
</service>
</beans>

Show
Gilles Delaby added a comment - security properties file : ------------------------------- 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=gilles org.apache.ws.security.crypto.merlin.keystore.alias=gilles org.apache.ws.security.crypto.merlin.file=serverStore.jks java.security : ------------------ security.provider.1=sun.security.provider.Sun security.provider.2=sun.security.rsa.SunRsaSign security.provider.3=com.sun.net.ssl.internal.ssl.Provider security.provider.4=com.sun.crypto.provider.SunJCE security.provider.5=sun.security.jgss.SunProvider security.provider.6=com.sun.security.sasl.Provider security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider services.xml: ------------------ <beans xmlns="http://xfire.codehaus.org/config/1.0"> <service> <name>AccessService</name> <namespace>http://test.com/AccessService</namespace> <serviceClass>com.test.services.access.IAccessService</serviceClass> <implementationClass>com.test.services.access.AccessService</implementationClass> <inHandlers> <handler handlerClass="com.test.services.handler.ValidateUserTokenHandler"/> <handler handlerClass="org.codehaus.xfire.util.dom.DOMInHandler"/> <bean class="org.codehaus.xfire.security.wss4j.WSS4JInHandler" xmlns=""> <property name="properties"> <props> <prop key="action">UsernameToken</prop> <prop key="passwordCallbackClass">com.test.services.handler.ServerPasswordHandler</prop> </props> </property> </bean> </inHandlers> <outHandlers> <handler handlerClass="org.codehaus.xfire.util.dom.DOMOutHandler" /> <bean class="org.codehaus.xfire.security.wss4j.WSS4JOutHandler" xmlns=""> <property name="properties"> <props> <prop key="action">Encrypt</prop> <prop key="encryptionPropFile">server_outsecurity_enc.properties</prop> <prop key="passwordCallbackClass">com.test.services.handler.ServerPasswordHandlerOut</prop> </props> </property> </bean> </outHandlers> </service> </beans>
Hide
Tomasz Sztelak added a comment -

Config looks good, so you have problem with you environment :/ make sure you have BouncyCastle jar in you class path.
Try to run ws-sec example and check if will run w/o problems.

Show
Tomasz Sztelak added a comment - Config looks good, so you have problem with you environment :/ make sure you have BouncyCastle jar in you class path. Try to run ws-sec example and check if will run w/o problems.
Hide
Tomasz Sztelak added a comment -

If you still have problem, post it on mailing list.

Show
Tomasz Sztelak added a comment - If you still have problem, post it on mailing list.
Hide
Jeffrey added a comment -

I've counted the same problem. I even changed the PC, but still it didn't work. I am desperated now. HELP! HELP!
yet I installed Unlimited Strength Jurisdiction Policy Files and the Bouncy Castle security provider.

myeclipse jdk1.6

Show
Jeffrey added a comment - I've counted the same problem. I even changed the PC, but still it didn't work. I am desperated now. HELP! HELP! yet I installed Unlimited Strength Jurisdiction Policy Files and the Bouncy Castle security provider. myeclipse jdk1.6

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: