本文整理汇总了C++中CK_FUNCTION_LIST_PTR::C_GenerateRandom方法的典型用法代码示例。如果您正苦于以下问题:C++ CK_FUNCTION_LIST_PTR::C_GenerateRandom方法的具体用法?C++ CK_FUNCTION_LIST_PTR::C_GenerateRandom怎么用?C++ CK_FUNCTION_LIST_PTR::C_GenerateRandom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CK_FUNCTION_LIST_PTR
的用法示例。
在下文中一共展示了CK_FUNCTION_LIST_PTR::C_GenerateRandom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DataMarshalling
//.........这里部分代码省略.........
sessionId = d->unpackInt();
dataLen = d->unpackInt();
data = (char *)d->unpackInt();
if (data != NULL) {
data = (char *)calloc(1, dataLen);
if (!data) {
printf("ERROR: NO MEM C_Verify\n");
break;
}
d->unpackMem((char *)data, dataLen);
}
signatureLen = d->unpackInt();
signature = (char *)d->unpackInt();
if (signature != NULL) {
signature = (char *)calloc(1, signatureLen);
if (!signature) {
printf("ERROR: NO MEM C_Verify\n");
break;
}
d->unpackMem((char *)signature, signatureLen);
}
{
CK_RV ret = 0;
DataMarshalling *d2 = new DataMarshalling(client);
/*
* Opening session
*/
ret = pFunctionList->C_Verify(sessionId, (CK_BYTE_PTR)data, dataLen, (CK_BYTE_PTR)signature, signatureLen);
d2->setMsgType(d->getMsgType());
d2->packInt((char *)&ret);
d2->sendData();
delete d2;
}
} else if (!strcmp(d->getMsgType(), "C_GenerateRandom")) {
CK_SESSION_HANDLE sessionId = 0;
char *data = NULL;
CK_ULONG dataLen = 0;
printf("Processing: C_GenerateRandom\n");
sessionId = d->unpackInt();
dataLen = d->unpackInt();
data = (char *)d->unpackInt();
if (data != NULL) {
data = (char *)calloc(1, dataLen);
if (!data) {
printf("ERROR: NO MEM C_GenerateRandom\n");
break;
}
//d->unpackMem((char *)data, dataLen);
}
{
CK_RV ret = 0;
DataMarshalling *d2 = new DataMarshalling(client);
/*
* Opening session
*/
ret = pFunctionList->C_GenerateRandom(sessionId, (CK_BYTE_PTR)data, dataLen);
d2->setMsgType(d->getMsgType());
d2->packInt((char *)&ret);
if (data != NULL)
d2->packMem((char *)data, dataLen);
d2->sendData();
delete d2;
}
} else if (!strcmp(d->getMsgType(), "C_SeedRandom")) {