Running Verify
The Verify sample application verifies the signature of XML data.
To run this sample application, execute the following command line in the etjava/examples directory.
java -classpath ../lib/enttoolkit.jar;<xalan.jar>;<xercesImpl.jar>;<xml-apis.jar> com.entrust.toolkit.examples.xml.sign.Verify <epf_file> <epf_pwd> <init.properties> <in_xml>|
Parameter |
Value |
|
<xalan.jar> |
The path of the xalan.jar third-party library. |
|
<xercesImpl.jar> |
The path of the xercesImpl.jar third-party library. |
|
<xml-apis.jar> |
The path of the xml-apis.jar third-party library. |
|
<epf_file> |
The path of an Entrust user profile in .epf file format. |
|
<epf_pwd> |
The password for accessing the Entrust profile. |
|
<init.properties> |
The URI of the init.properties initialization file for the IXSIL library. |
|
<in_xml> |
The file path of the signed XML contents to validate. |
For example:
D:\java\etjava\examples>java -classpath classes;..\lib\enttoolkit.jar;..\lib\xalan.jar;..\lib\xercesImpl.jar;..\lib\xml-apis.jarcom.entrust.toolkit.examples.xml.sign.Verify data\userdata\RSAUser1.epf ~Sample7~file:/d:/java/etjava/examples/data/xml/init/properties/init.propertiesfile:/d:/java/etjava/examples/sign.xmlJava installation directory:C:\Program Files\Java\j2re1.4.2JRE version: 1.4.2Java class path:classes;..\lib\enttoolkit.jarOS:Windows XPOS architecture:x86OS version:5.1File separator: \Path separator: ;Line separator: 0x0D 0x0AUser's account name: deletedUser's home directory: deletedUser's current working directory:D:\java\etjava\examplesJava VM version:1.4.2-b28Java library path: deletedXML DOM parser:nullXML SAX parser:nullXML XSLT implementation:nullLogging in to: data\userdata\RSAUser1.epfInitializing IXSIL properties from "file:/d:/java/etjava/examples/data/xml/init/properties/init.properties"...IXSIL has been initialized.dsig schema location: "http://www.w3.org/2000/09/xmldsig# file:/d:/java/etjava/examples/data/xml/init/schemas/Signature.xsd"WS Schema locations: " http://schemas.xmlsoap.org/ws/2002/07/utility http://schemas.xmlsoap.org/ws/2002/07/utility/ http://schemas.xmlsoap.org/ws/2002/12/secext http://schemas.xmlsoap.org/ws/2002/12/secext/ http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/"Schema locations: "http://www.w3.org/2000/09/xmldsig# file:/d:/java/etjava/examples/data/xml/init/schemas/Signature.xsd http://schemas.xmlsoap.org/ws/2002/07/utility http://schemas.xmlsoap.org/ws/2002/07/utility/ http://schemas.xmlsoap.org/ws/2002/12/secext http://schemas.xmlsoap.org/ws/2002/12/secext/ http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/"JAXP implementation: "jar:file:/D:/java/lib/xercesImpl.jar!/org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.class"--------- START OF file:/d:/java/etjava/examples/sign.xml SERIALIZED DOCUMENT ---------< version="1.0" encoding="UTF-8"?><dsig:Signature Id="Signature001" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="file:/d:/java/etjava/examples/build.xml"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>otHzQ36SiWLkgesLtF2A6ldN13o=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="#KeyInfo001"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>FIqy7L3U6OUKXmDqyq0TEAEkxCs=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>ONT0XalcfeFCkDc1GT7LCGoHOLz7C5+LfJ6Hyr0x+3WKtV7848+hBj4Rwf+7Sr9vj4HUkcKdVCft0fnK2OYiyz6beTmECQpDR7sJhyE3BWl1BaBhlm7ioWYh1N6evL168QjozYdBQSMzUVbx8A6JtLm0fEdefmowc/lEr/FH5Ew=</dsig:SignatureValue><dsig:KeyInfo Id="KeyInfo001"><dsig:X509Data><dsig:X509Certificate>MIIDiDCCAnCgA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kFKQAQuIEb4qz/dv7D1e8KN8T+P8SryktJcWehNeMLhauc8mDLHBf8YV9Exrf3NXrnhFHCKFu0f8EXhpWwpp1X/0bqjEh0dmrAdejQ6r7MaxoSVuevBaSWhWvxxVGgLQ9o=</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo></dsig:Signature>--------- END OF file:/d:/java/etjava/examples/sign.xml SERIALIZED DOCUMENT ---------Opening "file:/d:/java/etjava/examples/sign.xml"Creating a Verifier...Verify sample is demonstrating Method 1JAXP DOM implementation system property setting: nullJAXP implementation: "jar:file:/D:/java/lib/xercesImpl.jar!/org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.class"It's an Apache parser.Setting parser feature: namespace awarenessSetting parser feature: including ignorable whitespace in element contentSetting parser feature: not expanding entity referencesThis document validates correctly against the schema(s) provided.Verifying...Verified !The signature was verified using a valid certificate.URI of signed content: "file:/d:/java/etjava/examples/build.xml"URI of signed content: "#KeyInfo001"Done