Safelayer Secure Communications
 
 
Search
Home arrow Try arrow TrustedX Java API examples arrow Multiple XML Signature Generation


TeleTrust Innovation Price

Innovation Award
for TrustedX 2007

The European ICT Price. Nominee

for TrustedX 2007

Safelayer Labs
 
Try

TrustedX Java API examples

Multiple XML Signature Generation Print E-mail
16 January 2008

The objective of this example is to produce a multiple signature for an XML document using the TrustedX signature service. In order to understand this example, it is recommended that first you understand the previously seen example: XML Signature Generation.

To try this example, you must download the file called sampleSW5.zip and follow the instructions in Configuration of the Environment.

This example is very similar to the XML Signature Generation, example; however, in this example, the data to be included in the request is an XML signature and not an XML document. The filename file corresponds to the file generated in the DemoSignedDetachedSW.xml signature example.

The downloaded file already includes a file to be used for signing, but it can be replaced with the file generated in the previous example.

ssr.setInputXmlBase64(Util.readBinaryFileB64(path_in + filename));

This code also differs from the previous one, in that, it generates a second enveloped signature on top of an already existing signature i.e. it produces a multiple signature.

ssr.setSignaturePlacement(Constants.SignaturePlacement.ENVELOPED);

Again, the request must be sent to the TrustedX service, and, if all goes well, it will be possible to retrieve the XML signature in a file called DemoSignedDetachedSWMulti.xml.