Running Encrypt
The Encrypt sample application encrypts the following sample file and decrypts the result.
etjava/examples/data/xml/encrypt/encryptForAandB.xmlTo 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.encrypt.Encrypt <encryptor_efp_file> <recipient_epf_file> <epf_pwd> <init.properties> <path to encryptForAandB.xml> <path to decrypted file>|
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. |
|
<encryptor_efp_file> |
The file path of the Entrust profile for the user that encrypts the message. |
|
<recipient_epf_file> |
The file path of the Entrust profile for message recipient. You can reuse the <encryptor_efp_file> value for a trivial example. |
|
<epf_pwd> |
The password shared by both the Entrust profiles. |
|
<init.properties> |
The URI of the init.properties initialization file for the IXSIL library. |
|
<encrypted_xml> |
A file path for the encrypted XML. |
|
<decrypted_xml> |
A file path for the decrypted XML. |
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.encrypt.Encrypt data\userdata\RSAUser1.epf data\userdata\DSAUser1.epf~Sample7~ file:/d:/java/etjava/examples/data/xml/init/properties/init.propertiesdata/xml/encrypt/encryptForAandB_encrypted.xml data/xml/encrypt/encryptForAandB_decrypted.xmlInitializing IXSIL properties from "file:/d:/java/etjava/examples/data/xml/init/properties/init.properties"...Initializing XMLE properties from "file:/d:/java/etjava/examples/data/xml/init/properties/init.properties"...Logging in to: data\userdata\RSAUser1.epfLogging in to: data\userdata\DSAUser1.epfEncrypting for: cn=DSA User1,ou=PKI7,o=Java Toolkit Samples,c=CAWriting to: data/xml/encrypt/encryptForAandB_encrypted.xmlDecrypting..."cn=DSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA" is a recipient."cn=DSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA" will decrypt.Writing to: data/xml/encrypt/encryptForAandB_decrypted.xml