Using the C API

To create or use a z/OS PKCS #11 token, an application needs to do the following:
  1. Implicitly or explicitly load the PKCS #11 API DLL (CSNPCAPI for applications running in 31-bit addressing mode not using XPLINK, CSNPCA3X for applications running in 31-bit addressing mode using XPLINK, CSNPCA64 for 64-bit addressing mode ).
  2. Locate the functions within that DLL, using the C_GetFunctionList function.
  3. Call C_Initialize, which enables the application to call other functions in the API.
  4. Determine the slots present, using the C_GetSlotList function. This function returns a slot number for each existing token to which the application has access.
  5. To use an existing token, the application iterates through the slots using C_GetTokenInfo to find the token wanted.

    To create a new token, the application uses the C_WaitForSlotEvent function to add a new slot containing an uninitialized token. The application then uses the C_InitToken function to initialize the new token and save it in the TKDS.