Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-761

Add method to set digest algorithm for signature (WSS4J)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.5
    • Component/s: Security
    • Labels:
      None

      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>

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Added formatting.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Added formatting.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            oliverm Oliver Mihatsch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - Not Specified
              Not Specified
              Logged:
              Time Spent - 0.05h
              0.05h