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.jar
com.entrust.toolkit.examples.xml.sign.Verify data\userdata\RSAUser1.epf ~Sample7~
file:/d:/java/etjava/examples/data/xml/init/properties/init.properties
file:/d:/java/etjava/examples/sign.xml
Java installation directory:C:\Program Files\Java\j2re1.4.2
JRE version: 1.4.2
Java class path:classes;..\lib\enttoolkit.jar
OS:Windows XP
OS architecture:x86
OS version:5.1
File separator: \
Path separator: ;
Line separator: 0x0D 0x0A
User's account name: deleted
User's home directory: deleted
User's current working directory:D:\java\etjava\examples
Java VM version:1.4.2-b28
Java library path: deleted
XML DOM parser:null
XML SAX parser:null
XML XSLT implementation:null
 
Logging in to: data\userdata\RSAUser1.epf
Initializing 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/bu
ild.xml"><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<dsig:DigestValue>otHzQ36SiWLkgesLtF2A6ldN13o=</dsig:DigestValue></dsig:Referenc
e><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>ONT0XalcfeFC
kDc1GT7LCGoHOLz7C5+LfJ6Hyr0x+3WKtV7848+hBj4Rwf+7Sr9vj4HUkcKdVCft0fnK2OYiyz6beTmE
CQpDR7sJhyE3BWl1BaBhlm7ioWYh1N6evL168QjozYdBQSMzUVbx8A6JtLm0fEdefmowc/lEr/FH5Ew=
</dsig:SignatureValue><dsig:KeyInfo Id="KeyInfo001"><dsig:X509Data><dsig:X509Cer
tificate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t2BIlRLT4iuvaeG+qHPPXWAR0lihNkFKQAQuIEb4qz/dv7D1e8KN8T+P8Sr
yktJcWehNeMLhauc8mDLHBf8YV9Exrf3NXrnhFHCKFu0f8EXhpWwpp1X/0bqjEh0dmrAdejQ6r7MaxoS
VuevBaSWhWvxxVGgLQ9o=</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo></dsi
g: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 1
JAXP DOM implementation system property setting: null
JAXP implementation: "jar:file:/D:/java/lib/xercesImpl.jar!/org/apache/xerces/ja
xp/DocumentBuilderFactoryImpl.class"
It's an Apache parser.
Setting parser feature: namespace awareness
Setting parser feature: including ignorable whitespace in element content
Setting parser feature: not expanding entity references
 
This 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