Running KeyStoreExample
The KeyStoreExample sample application:
Creates a keystore initialization file
Protects the keystore with the password of the Entrust profile file (.epf).
Adds a credentials store to the keystore.
Adds a read/write certificate store to the keystore.
Logs into the new keystore using the Entrust profile password.
Reads certificates from the keystore
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'... DONELoading a KeyStore using the INI file 'KSIniFile.kst'... DONEExtracting the signing key from the KeyStore... DONEExtracting the decryption key from the KeyStore... DONEExtracting the verification certificate from the KeyStore... DONEExtracting the encryption certificate from the KeyStore... DONEWriting signing and encryption certificates to the read/write KeyStore certificate store... DONEReading signing and encryption certificates from the read/write KeyStore certificate store... DONEStoring the read/write KeyStore certificate store to 'ReadWriteCertStore.p12'... DONEClosing the KeyStore... DONEThe following keystore file is an example of the what the KeyStoreExample sample application produces:[Password Token]Magic Number=1789Version=6.0SaltValue=gWtD1niiWNs=Token=E73B47C6E9D43B04Protection=128MAC Algorithm=pbeWithSHA1AndCAST5-CBCHashCount=10000[Credential Store]CRType=EntrustProfileCRPath=data/userdata/RSAUser1.epf[Certificate Store]CSP12WriteCount=1CSP12Write1=ReadWriteCertStore.p12CSP12WritePwd1=IgBsjefYgzCeX0JjFrE+nhZeNPsuqHuPRnqJaBNKgPJh1ShuBfDaxYC9x_continue_=faNCewo[Integrity]MAC=BDBB87FC46A7FAA8