Signing message elements in generator security constraints with keywords

Before you begin

Prior to completing this task, you must import your application into an assembly tool.

For information on how to import your application, see Importing enterprise applications.

About this task

Complete the following steps to specify which message parts to digitally sign when you configure the generator security constraints for either the request generator or the response generator. The request generator is configured for the client and the response generator is configured for the server. In the following steps, you must configure either the client-side extensions in step 2 or the server-side extensions in step 3.

Procedure

  1. Start the assembly tool.
  2. Switch to the Java 2 Platform, Enterprise Edition (J2EE) perspective. Click Window > Open Perspective > J2EE.
  3. Optional: Locate the client-side extensions using the Project Explorer window. The Client Deployment Descriptor window is displayed. This Web service contains the extensions that you need to configure.
    1. Expand the Web Services > Client section and double-click the name of the Web service.
    2. Click the WS Extension tab and expand the Request Generator Configuration section.
  4. Optional: Locate the server-side extensions using the Project Explorer window. The Web Services Editor window is displayed. This Web service contains the extensions that you need to configure.
    1. Expand the Web Services > Services section and double-click the name of the Web service.
    2. Click the Extensions tab and expand the Response Generator Service Configuration Details section.
  5. Expand the Integrity section. Integrity refers to digital signature while confidentiality refers to encryption. Integrity decreases the risk of data modification when you transmit data across a network. For more information on digitally signing Simple Object Access Protocol (SOAP) messages, see XML digital signature.
  6. Click Add to indicate which parts of the message to sign. The Integrity Dialog window is displayed.
    1. Specify a name for the integrity element in the Integrity Name field. For example, you might specify int_webskey.
    2. Specify an order in the Order field. The value, which must be a positive integer value, specifies the order in which the digital signature is processed. An order value of 1 specifies that the signing is done first.
  7. Click Add under the Message Parts section and select the Message parts dialect. The http://www.ibm.com/websphere/webservices/wssecurity/dialect-was dialect specifies the message part that is signed using keywords. If you select this dialect, you can select one of the following keywords under the Message parts keyword heading:
    action
    Specifies that the <wsa:Action> element is signed.
    body
    Specifies the user data portion of the message. If you select this keyword, the body is signed.
    dsigkey
    Specifies that the key information element, which is used for digital signature, is signed.
    enckey
    Specifies that the key information element, which is used for encryption, is signed.
    messageid
    Specifies that the <wsa:MessageID> element within the message is signed.
    relatesto
    Specifies that the <wsa:RelatesTo> element within the message is signed.
    securitytoken
    Specifies that the UsernameToken in the SOAP message is signed.
    timestamp
    Specifies that the stand-alone timestamp element within the message is signed. The timestamp element determines whether the message is valid based upon the time that the message is sent and then received. If the timestamp option is selected, make sure that there is a stand-alone timestamp element in the message. If the element does not exist, see Adding a standalone timestamp in generator security constraints.
    to
    Specifies that the <wsa:To> element within the message is signed.
  8. Click OK to save the configuration changes.
    Note: These configurations for the generator and the consumer must match.

Example

The following example is a SOAP message whose body is signed using the body keyword and the http://www.ibm.com/websphere/webservices/wssecurity/dialect-was dialect:

<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/
       2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/
          oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType=
          "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#
          X509v3" wsu:Id="x509bst_956396521418196" xmlns:wsu="http://docs.oasis-open.org/
          wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> MA0GCSqGSIb3DQEBBQUAA4
          GBAHkthdGDgCvdIL9/vXUo74xpfOQd/rr1owBmMdb1TWdOyzwbOHC7lkUlnKrkI7SofwSLSDUP571ii
          MXUx3tRdmAVCoDMMFuDXh9V7212luXccx0s1S5KN0D3xW97LLNegQC0/b+aFD8XKw2U5ZtwbnFTRgs097
          dmz09RosDKkLlM
         </wsse:BinarySecurityToken>
         <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
            <ds:SignedInfo>
               <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                  <ec:InclusiveNamespaces PrefixList="wsse ds xsi soapenc xsd soapenv " 
                   xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
               </ds:CanonicalizationMethod>
               <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
               <ds:Reference URI="#wssecurity_signature_id_5945817517184298591">
                  <ds:Transforms>
                     <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                        <ec:InclusiveNamespaces PrefixList="p896 xsi soapenc xsd wsu soapenv " 
                         xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                     </ds:Transform>
                  </ds:Transforms>
                  <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                  <ds:DigestValue>vyu0JwXXSAvRCUCi6TPkeH8yUTU=</ds:DigestValue>
               </ds:Reference>
            </ds:SignedInfo>
            <ds:SignatureValue>dtbYA609wwAUAA8BmDmJlVHrWShy6OLJB3n4A6ToU0lI9tJrNhBksGqks17
             cykf+uHTJcgOY18XrRDN4wHTW4zm/tmD5WqQd8K1WpYaGpbwlFoiwKVFNyfQn2K/WbZ2JccmZvJGF
             aOtqStg6TqSUGLQSA5MCSpZUhck545IY2F4=
            </ds:SignatureValue>
            <ds:KeyInfo>
               <wsse:SecurityTokenReference>
                  <wsse:Reference URI="#x509bst_956396521418196" ValueType="http://docs.
                   oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
               </wsse:SecurityTokenReference>
            </ds:KeyInfo>
         </ds:Signature>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
    wsu:Id="wssecurity_signature_id_5945817517184298591" xmlns:wsu="http://docs.oasis-open.org/
    wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <p896:getVersion xmlns:p896="http://msgsec.wssecfvt.ws.ibm.com"/>
   </soapenv:Body>
</soapenv:Envelope>

What to do next

After you specify which message parts to digitally sign, you must specify which method is used to digitally sign the message. For more information, see Configuring signing information for the generator binding with an assembly tool.



In this information ...


Related concepts

IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Aug 29, 2010 5:25:00 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-base-dist&topic=twbs_specsignkeywdgenbind
File name: twbs_specsignkeywdgenbind.html