Server login samples

The samples in the ServerLoginExample folder create a .ual credential file and use this file for server login.

See Managing server logins for more information on the server login feature.

Installing the server login library

Depending on the operating system of your computer, you would need one of the following login libraries distributed in the etjava_90_lib.zip file.

OS

Library path in etjava_90_lib.zip

Library configuration

Windows

etjava/lib/win/x64/UALJNI_64.dll

Move this file to the %windir%\system32 folder on your computer.

Linux

etjava/lib/linux/X86_64/libualjni_64.so

Move this file to the LD_LIBRARY_PATH of your computer.

Compiling ServerLoginExample.java

Run the following command line in the etjava/examples directory.

javac -sourcepath source -d classes -classpath ../lib/enttoolkit.jar source/com/entrust/toolkit/examples/serverLogin/ServerLoginExample.java

Running ServerLoginExample

Run the following command line in the etjava/examples directory.

java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.serverLogin.ServerLoginExample <entrust.ini> <epf_file> <epf_pwd> <ual_file>

Parameter

Value

<entrust.ini>

The path of an Entrust initialization file with .ini extension.

<epf_file>

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

<epf_pwd>

The password for accessing the Entrust profile.

<ual_file>

The path of the new UAL credential file.

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.serverLogin.ServerLoginExample entrust.ini MyUser.epf MyUser.ual Passw0rd
 
binding...
Entrust ini file : entrust.ini
user's profile : MyUser.epf
user's password : Passw0rd
ual file : MyUser.ual
Done. UAL binding is successful.
time elapsed in millisecond : 63
 
logging in...
user's profile : MyUser.epf
ual file : MyUser.ual
Done. Server login is successful: status=0
time elapsed in millisecond : 343