[SWS-761] Add method to set digest algorithm for signature (WSS4J) Created: 11/Apr/12  Updated: 04/May/12  Resolved: 01/May/12

Status: Closed
Project: Spring Web Services
Component/s: Security
Affects Version/s: 2.0.4
Fix Version/s: 2.0.5

Type: Improvement Priority: Major
Reporter: Oliver Mihatsch Assignee: Arjen Poutsma
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 0.05h
Original Estimate: Not Specified

Reference URL: http://forum.springsource.org/showthread.php?125244-Missing-method-to-set-digest-algorithm-for-signature-%28WSS4J%29

 Description   

I wanted to change the digest algorithm which is used for signatures in secured SOAP Messages (default is SHA1). WSS4J supports this, but it seems this is not included in the Wss4jSecurityInterceptor facade (2.0.4.RELEASE) from Spring WS Security.
The constant "org.apache.ws.security.handler.WSHandlerConstants .SIG_DIGEST_ALGO" allows it to set the digest algorithm which is used in WSS signatures.

I patched the following code into the Wss4jSecurityInterceptor class and was then able to change the digest algorithm:

public void setSecurementSignatureDigestAlgorithm(String digestAlgo) {
    handler.setOption(WSHandlerConstants.SIG_DIGEST_AL GO, digestAlgo);
}

Context XML:

<bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j. Wss4jSecurityInterceptor">
.. snip ..
   <property name="securementSignatureDigestAlgorithm" value="http://www.w3.org/2001/04/xmlenc#sha256"/>
</bean>



 Comments   
Comment by Arjen Poutsma [ 01/May/12 ]

Added formatting.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Mon Dec 11 23:06:34 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.