KMLIB Callback Prototypes Reference

This chapter contains descriptions of the following callback prototypes:

>UICB_PromptConfirmation_t

>UICB_PromptForSmartCard_t

>UICB_PromptInt32_t

>UICB_PromptKeyComponent_t

>UICB_PromptPin_t

>UICB_PromptString_t

>UICB_PromptTokenPin_t

>UICB_ShowExportHeader_t

>UICB_ShowImportHeader_t

>UICB_ShowKeyComponent_t

>UICB_ShowMsg_t

>UICB_ShowSCBatchInfo_t

Example of Callback Prototype Use

The following code demonstrates callback prototype use using the PromptString callback.

/** Function prototype */
 
static CK_RV PromptString(
   const char *pszMessage,
   char *pBuf, CK_ULONG *pBufLen
);
 
/** Function implementation */
 
static CK_RV PromptString(
   const char* pszMessage, 
   char* pBuf,
   CK_ULONG* pBufLen
);
 
{
   CK_RV rv = CKR_OK;
   printf("%s", pszMessage);
   ReadLine(pBuf, *pBufLen);
   return rv;
}
 
 
int main(void){
 
   :
   :
 
   KM_Callbacks_t km_callbacks;
   memset(&km_callbacks, 0, sizeof(km_callbacks));
   km_callbacks.promptString       = PromptString;
 
   :
 
}