Running KeyStoreExample

The KeyStoreExample sample application:

  1. Creates a keystore initialization file

  2. Protects the keystore with the password of the Entrust profile file (.epf).

  3. Adds a credentials store to the keystore.

  4. Adds a read/write certificate store to the keystore.

  5. Logs into the new keystore using the Entrust profile password.

  6. Reads certificates from the keystore

  7. Writes signing and encryption certificates to the certificate store

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.keystore.KeyStoreExample <epf_file> <epf_pwd>

Parameter

Value

<epf_file>

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

<epf_pwd>

The password for accessing the Entrust profile.

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.keystore.KeyStoreExample data/userdata/RSAUser1.epf ~Sample7~
 
Creating KeyStore INI file 'KSIniFile.kst'... DONE
Loading a KeyStore using the INI file 'KSIniFile.kst'... DONE
Extracting the signing key from the KeyStore... DONE
Extracting the decryption key from the KeyStore... DONE
Extracting the verification certificate from the KeyStore... DONE
Extracting the encryption certificate from the KeyStore... DONE
Writing signing and encryption certificates to the read/write KeyStore certificate store... DONE
Reading signing and encryption certificates from the read/write KeyStore certificate store... DONE
Storing the read/write KeyStore certificate store to 'ReadWriteCertStore.p12'... DONE
Closing the KeyStore... DONE
The following keystore file is an example of the what the KeyStoreExample sample application produces:
[Password Token]
Magic Number=1789
Version=6.0
SaltValue=gWtD1niiWNs=
Token=E73B47C6E9D43B04
Protection=128
MAC Algorithm=pbeWithSHA1AndCAST5-CBC
HashCount=10000
 
[Credential Store]
CRType=EntrustProfile
CRPath=data/userdata/RSAUser1.epf
 
[Certificate Store]
CSP12WriteCount=1
CSP12Write1=ReadWriteCertStore.p12
CSP12WritePwd1=IgBsjefYgzCeX0JjFrE+nhZeNPsuqHuPRnqJaBNKgPJh1ShuBfDaxYC9x
_continue_=faNCewo
 
[Integrity]
MAC=BDBB87FC46A7FAA8