Adding time stamps for integrity to generator security constraints with keywords

This task is used to specify that a time stamp is embedded in a particular element and that the element is signed. Complete the following steps to specify the time stamp for integrity using keywords 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, configure either the client-side extensions in step 2 or the server-side extensions in step 3.

  1. Click Window > Open Perspective > J2EE.

  2. 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. Complete the following steps to locate the client-side extensions:

    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.

  3. 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. Complete the following steps to locate the server-side extensions:

    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.

  4. 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.

  5. Click Add to specify a time stamp for integrity. The Integrity Dialog window is displayed. Complete the following steps to specify a configuration:

    1. Specify a name for the integrity element in the Integrity Name field.

    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.

  6. In the Timestamp section, click Add and select the Timestamp dialect. The http://www.ibm.com/websphere/webservices/wssecurity/dialect-was dialect specifies the message element to which the time stamp is added prior to signing the element using the keywords. If you select this dialect, you can select one of the following keywords under the Timestamp keyword heading:

    body

    Specifies the user data portion of the message. If you select the body option, a time stamp is embedded in Simple Object Access Protocol (SOAP) body and the body is signed.

    timestamp

    Specifies that the time stamp is embedded in the stand-alone timestamp element within the message and that it is signed. If you select the timestamp option, make sure that there is a stand-alone timestamp element in the message. If the element does not exist, see Adding a stand-alone time stamp to generator security constraints.

    securitytoken

    Specifies that the security token authenticates the client. If you select this option, the timestamp element is embedded in the securitytoken element and the security token is signed.

    dsigkey

    Specifies that the time stamp is inserted into the key information element, which is used for digital signature, and the key information element is signed.

    enckey

    Specifies that the time stamp is inserted into the key information element, which is used for encryption, and the key information element is signed.

    messageid

    Specifies that the time stamp is inserted into the <wsa:MessageID> element and the <wsa:MessageID> element is signed.

    to

    Specifies that the time stamp is inserted into the <wsa:To> element within the message and that the <wsa:To> element is signed.

    action

    Specifies that the <wsa:Action> element is signed.

    relatesto

    Specifies that the time stamp is inserted into the <wsa:RelatesTo> element within the message and the <wsa:RelatesTo> element is signed.

  7. Specify an expiration time for the time stamp in the Timestamp expires field. The time stamp helps defend against replay attacks. The lexical representation for the duration is the [ISO 8601] extended format PnYnMnDTnHnMnS, where:

    P

    Precedes the date and time values.

    nY

    Represents the number of years in which the time stamp is in effect. Select a value from 0 to 99 years.

    nM

    Represents the number of months in which the time stamp is in effect. Select a value from 0 to 11 months.

    nD

    Represents the number of days in which the time stamp is in effect. Select a value from 0 to 30 days.

    T

    Separates the date and time values.

    nH

    Represents the number of hours in which the time stamp is in effect. Select a value from 0 to 23 hours.

    nM

    Represents the number of minutes in which the time stamp is in effect. Select a value from 0 to 59 minutes.

    nS

    Represents the number of seconds in which the time stamp is in effect. The number of seconds can include decimal digits to aribrary precision. You can select a value from 0 to 59 for the seconds and from 0 to 9 for tenths of a second.

    For example, to indicate 1 year, 2 months, 3 days, 10 hours, and 30 minutes, the format is P1Y2M3DT10H30M. Typically, you might configure a message time stamp for between 10 and 30 minutes. For example, 10 minutes is represented as P0Y0M0DT0H10M0S or PT10M.

  8. In the Message Parts section, click Add and select http://www.ibm.com/websphere/webservices/wssecurity/dialect-was in the Message parts dialect field.

  9. In the Message Parts section, select the message parts keyword.

    Important: You must define at least one message part in the Message Parts section in order to specify a time stamp for integrity.

  10. Click OK to save the configuration changes.

    Note: These configurations for the generator and the consumer must match.

    In addition to the time stamp, you can specify that the nonce is signed. For more information, see the following articles:

The following example shows a time stamp that is inserted in the SOAP message body and signed:

<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_6212871821454005389" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/
          oasis-200401-wss-wssecurity-utility-1.0.xsd"> AgBgkqhkiG9w0BCQEWE21hcnV5YW1hQGpwLmlibS5jb22
          CAgEBMA0GCSqGSIb3DQEBBQUAA4GBAHkthdGDgCvdIL9/vXUo74xpfOQd/rr1owBmMdb1TWdOyzwbOHC7lkUlnKrkI7
          SofwSLSDUP571iiMXUx3tRdmAVCoDMMFuDXh9V7212luXccx0s1S5KN0D3xW97LLNegQC0/b+aFD8XKw2U5ZtwbnFTRgs
          097dmz09RosDKkLlM</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_493518228178200731">
                  <ds:Transforms>
                     <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                        <ec:InclusiveNamespaces PrefixList="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>kKrcmc8saJ91JCNiE33UECoNYz8=</ds:DigestValue>
               </ds:Reference>
            </ds:SignedInfo>
            <ds:SignatureValue>XBpPju5+qH4bBFodO1kbBO54kEdBD0Pr5ohnXa3TPrDwXqmr67zDP3ZTk7iBSADnH+dlfKup
             Fhx+NZu2h5/j1/KYWaR2HTTv/KYE6IdqXVz3EFglUIBLzQnJ2Zbn62eBx5Th285Cn2Vrxtdb5BvUa1dt6M6k61CvRlz3
             /nMhQxk=</ds:SignatureValue>
            <ds:KeyInfo>
               <wsse:SecurityTokenReference>
                  <wsse:Reference URI="#x509bst_6212871821454005389" 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_493518228178200731" xmlns:wsu="http://docs.oasis-open.org/
    wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <getVersion/>
      <wsu:Timestamp wasextention="wedsig">
         <wsu:Created>2004-10-12T15:58:19.201Z</wsu:Created>
      </wsu:Timestamp>
   </soapenv:Body>
</soapenv:Envelope>

After you specify which message parts to digitally sign, 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.

 

Related tasks

Adding a stand-alone time stamp to generator security constraints

Adding a nonce for integrity to generator security constraints with an XPath expression

Configuring signing information for the generator binding with an assembly tool

Adding a nonce for integrity in generator security constraints with keywords