[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


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"/>

Comment by Arjen Poutsma [ 01/May/12 ]

Added formatting.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Wed Nov 14 21:55:14 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.