Linking a program with the ICSF callable services
For sample routines using the ICSF callable services for the following languages: C, COBOL, Assembler, and PL/I, see Coding examples.
ICSF provides two methods for linking ICSF callable services into an application program. Use the appropriate sample that follows.
For applications that use OS linkage (such as COBOL, High Level Assembler, or PL/I)
In the SYSLIB concatenation, include the CSF.SCSFSTUB module in the link edit step. This provides the application program access to all ICSF callable services (those that can be invoked in AMODE(24)/AMODE(31) as well as those that can be invoked in AMODE(64)).
//LKEDENC JOB
//*-----------------------------------------------------------------*
//* *
//* The JCL links the ICSF encipher callable service, CSNBENC, *
//* into an application called ENCIPHER. *
//* *
//*-----------------------------------------------------------------*
//LINK EXEC PGM=IEWL,
// PARM='XREF,LIST,LET'
//SYSPRINT DD SYSOUT=*
//SYSLIB DD DSN=CSF.SCSFSTUB,DISP=SHR * SERVICES ARE IN HERE
//SYSLMOD DD DSN=MYAPPL.LOAD,DISP=SHR * MY APPLICATION LIBRARY
//SYSLIN DD DSN=MYAPPL.ENCIPHER.OBJ,DISP=SHR * MY ENCIPHER PROGRAM
// DD *
ENTRY ENCIPHER
NAME ENCIPHER(R)
/*For applications written in C/C++
The following
dynamic link libraries (DLLs) are linked into SYS1.SIEALNKE:
- CSFDLL31
- ICSF services in 31-bit addressing mode.
- CSFDLL64
- ICSF services in 64-bit addressing mode.
- CSFDLL3X
- ICSF services in 31-bit addressing mode using XPLINK.
Link with the appropriate side deck as you would with any other DLL. For example, to link with an
application running in 64-bit addressing mode, include the header for the service prototypes in your
C/C++ application with:
#include <csfbext.h>and then compile normally.
Finally, to
link:c89 -Wc,dll,lp64 -Wl,dll,lp64 -o MyApplication MyApp_main.o MyApp_support.o
/usr/lpp/pkcs11/lib/CSFDLL64.xSee Appendix A (SMP/E installation data sets, directories, and files) in z/OS Cryptographic Services ICSF Writing PKCS #11 Applications for more information about compiling and linking C/C++ applications.