|
PERMISION NOTICE AND DISCLAIMER This website contains certain downloadable software. This software is copyrighted and the copyrighter claims all exclusive rights to such software. The copyright owner of the software that you download through this site may be indicated in the accompanying read-me file and in the accompanying source code as well as in the area of this Web Site from which the software is downloaded. Permission to use, copy, modify and distribute this software and its source code for non commercial purposes and without fee is hereby granted, provided that the name of the copyright owner or related contributors not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright owner and contributors makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. The copyright owner and its contributors disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author and the contributors be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of this software. AcceptCancel
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 sampleAxis5.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 DemoSignedDetached.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. In the following instruction, filename contains the name of the mentioned file.
InputDocuments idoc = new InputDocuments();
Document doc = new Document();
doc.setBase64XML(Util.readBinaryFile(path_in + filename));
idoc.setDocument(doc);
sr.setInputDocuments(idoc);
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.
opt.setSignaturePlacement(new SignaturePlacement());
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 DemoSignedDetachedMulti.xml.
|