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

        oliverm Oliver Mihatsch created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Assignee Arjen Poutsma [ arjen.poutsma ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.0.5 [ 12848 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Added formatting.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Added formatting.
        arjen.poutsma Arjen Poutsma made changes -
        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>
        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:

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

        Context XML:
        {code: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>
        {code}
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma logged work - 01/May/12 7:52 AM
        • Time Spent:
          0.05h
           
          <No comment>
        arjen.poutsma Arjen Poutsma made changes -
        Time Spent 0.05h [ 180 ]
        Worklog Id 28634 [ 28634 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Complete [ 8 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        20d 6h 34m 1 Arjen Poutsma 01/May/12 7:48 AM
        In Progress In Progress Resolved Resolved
        4m 1s 1 Arjen Poutsma 01/May/12 7:52 AM
        Resolved Resolved Closed Closed
        2d 23h 11m 1 Arjen Poutsma 04/May/12 7:03 AM

          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