Skip to content

Add method to set digest algorithm for signature (WSS4J) [SWS-761] #848

@gregturn

Description

@gregturn

Oliver Mihatsch opened SWS-761 and commented

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>

Affects: 2.0.4

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

Referenced from: commits d631f72

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions