User guide
Settings for the SOAP Digital Signature
15-9
Settings for the SOAP Digital Signature
This section explains the following topics:
• Generating a SOAP Digital Signature
• Verifying the SOAP Digital Signature for SOAP Messages
Generating a SOAP Digital Signature
The following explains the procedure for generating a SOAP digital signature.
Implementing an Application that Attaches a SOAP Digital Signature
An application that generates a SOAP digital signature is implemented by changing the Web service
information. There is no need to change the application programs.
For an application that uses the Messaging method, settings for the signature target can be simplified by
adding an ID attribute to the element being signed.
In the original assurance function (SOAP digital signature/XML encryption), the following attributes are
regarded as an ID attribute:
Namespace URI: http://schemas.xmlsoap.org/ws/2002/07/utility
Local Name: “Id”
The following shows an example in which an ID attribute with the value "body" is attached to SOAPBody
using the SAAJ-API.
Example
.....
String prefix = "wsu";
String uri = "http://schemas.xmlsoap.org/ws/2002/07/utility";
SOAPEnvelope env = ...;
SOAPBody body = env.getBody();
body.addNamespaceDeclaration(prefix, uri);
body.addAttribute(env.createName("Id", prefix, uri), "body");
.....
If an attachment file is to be a target of the SOAP digital signature, the MIME header "Content-Id" needs
to be added to the attachment file.
The following shows an example in which the MIME header "Content-Id" with the value "sample.jpg" is
added to the attachment file.
Example
import javax.xml.soap.*;
.....
AttachmentPart _ap = ...;