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 aim of this example is to validate the document signature that was produced in the PDF Signature Generation example. To understand this example, you must first understand the CMS/PKCS#7 Signature Verification example.
To try this example, you must download the file, sampleSW13.zip, and follow the instructions in Configuration of the Environment.
The downloaded file contains the signature to be verified but if you wish you can replace it with the one generated in the PDF Signature Generation example to check the validity of the signature
This example is very similar to the CMS/PKCS#7 Signature Verification example; however, in this case we are verifying a PDF signature.
SmartVerifyRequest svr = new SmartVerifyRequest(host);
svr.setProfile(Constants.Profile.PDF);
To verify a PDF signature, we simply enter the PDF document because it already contains the signature. Therefore, we invoke the setInputPdfBase64Data() method.
svr.setInputPdfBase64Data(Util.readBinaryFileB64(path_in + signatureFile));
Once all the data has been entered in the request, we invoke the send() operation to send the request to the host and collect the response in a SmartVerifyResponse object.
SmartVerifyResponse svrs = svr.send();
After executing the example, we obtain a response like the one below.
** RESPONSE **
---------------------
Signature num 0
---------------------
** Certificate **
Major: urn:oasis:names:tc:dss:1.0:resultmajor:Success
Minor: urn:oasis:names:tc:dss:1.0:resultminor:ValidSignature_OnAllDocuments
DN: CN=Dave, OU=Demo, O=TrustedX, C=ES
Issuer Trust Level: 0
Issuer Trust Label: Administration
|