Running the Decode sample

The Decode sample decodes and optionally verifies a PKCS #7 message.

To run this sample application, execute the following command line in the etjava/examples directory.

java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.pkcs7.Decode <epf_file> <epf_pwd> <input> <output> [-dir <ip>] [<cert>]

Parameter

Value

<epf_file>

The path of an Entrust user profile in .epf file format.

<epf_pwd>

The password for accessing the Entrust profile.

<input>

The path of the encoded input file.

<output>

The path of the decoded output file

<ip>

An optional IP address

<cert>

An optional list of certificate file paths.

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.pkcs7.Decode data/userdata/RSAUser1.epf ~Sample7~ data/testfiles/test.p7m data/testfiles/test.decryptedp7m.txt
 
profile: data/userdata/RSAUser1.epf
password: ~Sample7~
input file: data/testfiles/test.p7m
output file: data/testfiles/test.decryptedp7m.txt
offline
 
login
done
decoding
Operation: SIGN_AND_ENCRYPT
Signer 1: cn=RSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA
Serial Number: 1064926582
Issuer: ou=PKI7,o=Java Toolkit Samples,c=CA
 
Included Certs:
Subject: cn=RSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA
Serial Number: 1064926582
Issuer : ou=PKI7,o=Java Toolkit Samples,c=CA
 
Subject: cn=RSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA
Serial Number: 1064926583
Issuer : ou=PKI7,o=Java Toolkit Samples,c=CA
 
Subject: ou=PKI7,o=Java Toolkit Samples,c=CA
Serial Number: 1064926513
Issuer : ou=PKI7,o=Java Toolkit Samples,c=CA
 
done