|
|
The topic contains the following sections:
The Security sample application demonstrates using Username/Password authentication. The sample application has both C++ and Java client applications. For a description of the Security sample application, see Writing a WLE CORBA Application That Implements Security This section describes how to build the Security sample application and how to use the client applications in the Security sample application.
Perform the following steps to build the Security sample application:
Building and Running the Security Sample Application
The following sections describe these steps.
Refer to Readme.txt in the \ WLEdir \samples\corba\university \security directory for troubleshooting information and the latest information about using the Security sample application.
You need to copy the files for the Security sample application into a work directory on your local machine. The files for the Security sample application are located in the following directories:
Windows NT
drive :\ WLEdir \samples\corba\university \security
UNIX
/usr/ WLEdir /samples/corba/university /security
In addition, you need to copy the utils directory into your work directory. The utils directory contains files that set up logging, tracing, and access to the database used with the Security sample application.
You will use the files listed in Table 6-1 to create the Security sample application.
Before building and running the Security sample application, you need to ensure that certain environment variables are set on your system. In most cases, these environment variables are set as part of the installation procedure. However, you need to check the environment variables to ensure they reflect correct information.
Table 6-5 lists the environment variables required to run the Security sample application.
Step 2: Verify the settings of the environment variables.
To verify that the information for the environment variables defined during installation is correct, perform the following steps:
Windows NT
The Control Panel appears.
The System Properties window appears.
The Environment page appears.
UNIX
ksh prompt>printenv TUXDIR
ksh prompt>printenv JAVA_HOME
To change the settings, perform the following steps:
Windows NT
UNIX
ksh prompt>export TUXDIR= directorypath
ksh prompt>export JAVA_HOME= directorypath
During the installation of the WLE software, the sample application files are marked read-only. Before you can edit the files or build the files in the Security sample application, you need to change the protection of the files you copied into your work directory, as follows:
Windows NT
prompt>attrib -r drive:\ workdirectory \*.*
UNIX
prompt>chmod u+rw / workdirectory /*.*
Use the following command to set the environment variables used to build the client and server applications in the Security sample application:
Windows NT
prompt>setenvs
UNIX
prompt>/bin/ksh
prompt>. ./setenvs.sh
Use the following command to initialize the database used with the Security sample application:
Windows NT
prompt>nmake -f makefiles.nt initdb
UNIX
prompt>make -f makefiles.mk initdb
Use the following command to load the UBBCONFIG file:
Windows NT
prompt>tmloadcf -y ubb_s.nt
UNIX
prompt>tmloadcf -y ubb_s.mk
The build process for the UBBCONFIG file prompts you for an application password. This password will be used to log on to the client applications. Enter the password and press Enter. You are then prompted to verify the password by entering it again.
The directory for the Security sample application contains a makefile that builds the client and server sample applications in the Security sample application.
Use the following command to build the C++ client and server applications in the Security sample application:
Windows NT
prompt>nmake -f makefiles.nt
UNIX
prompt>make -f makefiles.mk
To build the Java client application in the Security sample application:
Windows NT
prompt>nmake -f makefiles.nt javaclient
UNIX
prompt>make -f makefiles.mk javaclient
Start the system processes and the server application in the Security sample application by entering the following command:
prompt>tmboot -y
Before using another sample application, enter the following command to stop the system processes and the server application in the Security sample application.
prompt>tmshutdown
Start the C++ client application in the Security sample application by performing the following steps:
prompt>univs_client
To run the Java client application in the Security sample application, perform the following steps:
code="UnivSApplet.class"
codebase=.
to read as follows:
code="UnivSApplet"
archive="UnivSApplet.jar,m3envobj.jar"
Copy the class files in the Security sample application directory that were generated by the makefile
into the tmp
directory, set the directory (cd
) to the tmp
directory, and issue one of the following commands to create a jar file that contains all the Security sample application classes:
jar -cf ..\UnivSApplet.jar *.*
(Microsoft Windows NT systems)
jar -cf ../UnivSApplet.jar *
(UNIX systems)
Note: On Microsoft Windows NT systems, the node name needs to be in all uppercase characters. For example, if the node is specified as SERVER in the UBBCONFIG file and in the UnivSApplet.html file, set your browser to http://SERVER/UnivSApplet.html .
code="UnivSApplet.class"
codebase=.
to read as follows:
code="UnivSApplet"
archive="UnivSApplet.jar,m3envobj.jar"
Copy the class files in the Security sample application directory that were generated by the makefile
into the tmp
directory, set the directory (cd
) to the tmp
directory, and issue one of the following commands to create a jar file that contains all the Production sample application classes:
jar -cf ..\UnivSApplet.jar *.*
(Microsoft Windows NT systems)
jar -cf ../UnivSApplet.jar *
(UNIX systems)
Note: On Microsoft Windows NT systems, the node name needs to be in all uppercase characters. For example, if the node is specified as SERVER in the UBBCONFIG file and in the UnivSApplet.html file, set your browser to http://SERVER/UnivPApplet.html .
A logon window appears.
The Secure Simpapp sample application demonstrates using the SSL protocol and certificate-based authentication to protect communications between client applications and the WLE domain. There are C++ and Java versions of the Secure Simpapp sample application.
Perform the following steps to build and run the Secure Simpapp sample application:
Before you can use the Secure Simpapp sample application, obtain a certificate and private key (IIOPListener.pem ) for the IIOP Listener/Handler from the certificate authority in your enterprise and load the certificate in a Lightweight Directory Access Protocol (LDAP)-enabled directory service. The runme command prompts you for the pass phrase for the private key for the IIOP Listener/Handler.
You need to copy the files for the Secure Simpapp sample application into a work directory on your local machine. The following sections detail the directory location and sources files for the C++ and Java versions of the Secure Simpapp sample application.
The files for the C++ version of the Secure Simpapp sample application are located in the following directories:
Windows NT
drive:\WLEdir \samples\corba\simpappSSL
UNIX
/usr/local/WLedir /samples/corba/simappSSL
You will use the files listed in Table 6-3 to build and run the C++ version of the Secure Simpapp sample application.
The files for the Java version of the Secure Simpapp sample application are located in the following directories:
Windows NT
drive:\WLEdir
\samples\corba\simpappSSL_java
UNIX
/usr/local/WLedir
/samples/corba/simappSSL_java
You will use the files listed in Table 6-4 to build and run the Java Secure Simpapp sample application.
Java Version of the Secure Simpapp Sample Application
During the installation of the WLE software, the sample application files are marked read-only. Before you can edit or build the files in the Secure Simpapp sample application, you need to change the protection attribute of the files you copied into your work directory, as follows:
Windows NT
prompt>attrib -r
drive:
\workdirectory
\*.*
UNIX
prompt>/bin/ksh
ksh prompt>chmod u+w /
workdirectory
/*.*
On the UNIX operating system platform, you also need to change the permission of runme.ksh
to give execute permission to the file, as follows:
ksh prompt>chmod +x runme.ksh
Before building and running the Secure Simpapp sample application, you need to ensure that certain environment variables are set on your system. In most cases, these environment variables are set as part of the installation procedure. However, you need to check the environment variables to ensure they reflect correct information.
Table 6-5 lists the environment variables required to run the Secure Simpapp sample application.
Step 2: Change the protection attribute on the files for the Secure Simpapp sample application.
Step 3: Verify the settings of the environment variables.
To verify that the information for the environment variables defined during installation is correct, perform the following steps:
Windows NT
The Control Panel appears.
The System Properties window appears.
The Environment page appears.
UNIX
ksh prompt>printenv TUXDIR
ksh prompt>printenv JAVA_HOME
To change the settings, perform the following steps:
Windows NT
UNIX
ksh prompt>export TUXDIR= directorypath
ksh prompt>export JAVA_HOME= directorypath
The runme command automates the following steps:
Note: You can also run the Secure Simpapp sample application manually. The steps for manually running the Secure Simpapp sample application are described in the Readme.html file.
To build and run the Secure Simpapp sample application, enter the runme command, as follows:
Windows NT
prompt>cd workdirectory
prompt>runme
UNIX
ksh prompt>cd workdirectory
ksh prompt>./runme.ksh
The Secure Simpapp sample application runs and prints the following messages:
Testing simpapp
cleaned up
prepared
built
loaded ubb
booted
ran
shutdown
saved results
PASSED
During execution of the runme command, you are prompted for a password. Enter the pass phrase of the private key of the IIOP Listener/Handler.
Table 6-6 lists the C++ files in the work directory generated by the runme command.
File |
Description |
---|---|
Table 6-7 lists the Java files in the work directory generated by the runme
command.
Table 6-8 lists files in the RESULTS
or JRESULTS
directory generated by the runme
command.
Run the server application in the Secure Simpapp sample application, as follows:
Windows NT
prompt>tmboot
UNIX
ksh prompt>tmboot
Run the client application in the Secure Simpapp sample application, as follows:
Windows NT
prompt>java -classpath .;%TUXDIR%\udataobj\java\jdk\m3envobj.jar UNIX
ksh prompt>java -classpath .:$TUXDIR/udataobj/java/jdk\
Note:
The Secure Simpapp sample client application uses the client-only JAR file m3envobj.jar
. However, you can also use the m3.jar
file to run the client application.
Before using another sample application, enter the following commands to stop the Secure Simpapp sample application and to remove unnecessary files from the work directory:
Windows NT
prompt>tmshutdown -y
prompt>nmake -f makefile.nt clean
UNIX
ksh prompt>tmshutdown -y
ksh prompt>make -f makefile.mk clean
Using the Secure Simpapp Sample Application
-DTOBJADDR=%TOBJADDR% SimpleClient
String?
Hello World
HELLO WORLD
hello world
/m3envobj.jar -DTOBJADDR=$TOBJADDR SimpleClient
String?
Hello World
HELLO WORLD
hello world
|
Copyright © 1999 BEA Systems, Inc. All rights reserved.
|