KMLIB Callback Prototypes Reference
This chapter contains descriptions of the following callback prototypes:
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;
:
}