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.
Why and when to perform this task
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, you must configure either
the client-side extensions in step 2 or the server-side extensions in step
3.
Steps for this task
- Start the assembly tool and click Window > Open Perspective
> J2EE.
- 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:
- Expand the Web Services > Client section and double-click the
name of the Web service.
- Click the WS Extension tab and expand the Request Generator
Configuration section.
- 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:
- Expand the Web Services > Services section and double-click
the name of the Web service.
- Click the Extensions tab and expand the Response Generator
Service Configuration Details section.
- 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.
- Click Add to specify a time stamp for integrity. The
Integrity Dialog window is displayed. Complete the following steps to specify
a configuration:
- Specify a name for the integrity element in the Integrity Name
field.
- 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.
- 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.
- 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.
- In the Message Parts section, click Add and select http://www.ibm.com/websphere/webservices/wssecurity/dialect-was
in the Message parts dialect field.
- 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.
- 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:
Example
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"> AgBgkqhkiG9w0BCQEWE21hcnV5Y
W1hQGpwLmlibS5jb22CAgEBMA0GCSqGSIb3DQEBBQUAA4GBAHkthdGDgCvdIL9/vXUo74xpfOQd/rr1owB
mMdb1TWdOyzwbOHC7lkUlnKrkI7SofwSLSDUP571iiMXUx3tRdmAVCoDMMFuDXh9V7212luXccx0s1S5KN
0D3xW97LLNegQC0/b+aFD8XKw2U5ZtwbnFTRgs097dmz09RosDKkLlM</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+qH4bBFodO1kbBO54kEdBD0Pr5ohnXa3TPrDwXqmr67zDP3ZTk7iBS
ADnH+dlfKupFhx+NZu2h5/j1/KYWaR2HTTv/KYE6IdqXVz3EFglUIBLzQnJ2Zbn62eBx5Th285Cn2Vr
xtdb5BvUa1dt6M6k61CvRlz3/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>