本文整理汇总了C++中CK_FUNCTION_LIST_PTR::C_CopyObject方法的典型用法代码示例。如果您正苦于以下问题:C++ CK_FUNCTION_LIST_PTR::C_CopyObject方法的具体用法?C++ CK_FUNCTION_LIST_PTR::C_CopyObject怎么用?C++ CK_FUNCTION_LIST_PTR::C_CopyObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CK_FUNCTION_LIST_PTR
的用法示例。
在下文中一共展示了CK_FUNCTION_LIST_PTR::C_CopyObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: usage
//.........这里部分代码省略.........
three[5].ulValueLen = key_len;
three[6].type = CKA_VALUE;
three[6].pValue = "Object three";
three[6].ulValueLen = strlen(three[6].pValue);
ck_rv = epv->C_CreateObject(h, one, 7, &hOneIn);
if( CKR_OK != ck_rv ) {
PR_fprintf(PR_STDERR, "C_CreateObject(%lu, one, 7, ) returned 0x%08x\n", h, ck_rv);
return 1;
}
PR_fprintf(PR_STDOUT, " Created object one: handle = %lu\n", hOneIn);
ck_rv = epv->C_CreateObject(h, two, 7, &hTwoIn);
if( CKR_OK != ck_rv ) {
PR_fprintf(PR_STDERR, "C_CreateObject(%lu, two, 7, ) returned 0x%08x\n", h, ck_rv);
return 1;
}
PR_fprintf(PR_STDOUT, " Created object two: handle = %lu\n", hTwoIn);
ck_rv = epv->C_CreateObject(h, three, 7, &hThreeIn);
if( CKR_OK != ck_rv ) {
PR_fprintf(PR_STDERR, "C_CreateObject(%lu, three, 7, ) returned 0x%08x\n", h, ck_rv);
return 1;
}
PR_fprintf(PR_STDOUT, " Created object three: handle = %lu\n", hThreeIn);
delta[0].type = CKA_VALUE;
delta[0].pValue = "Copied object";
delta[0].ulValueLen = strlen(delta[0].pValue);
ck_rv = epv->C_CopyObject(h, hThreeIn, delta, 1, &hDeltaIn);
if( CKR_OK != ck_rv ) {
PR_fprintf(PR_STDERR, "C_CopyObject(%lu, %lu, delta, 1, ) returned 0x%08x\n",
h, hThreeIn, ck_rv);
return 1;
}
PR_fprintf(PR_STDOUT, " Copied object three: new handle = %lu\n", hDeltaIn);
mask[0].type = CKA_APPLICATION;
mask[0].pValue = key;
mask[0].ulValueLen = key_len;
ck_rv = epv->C_FindObjectsInit(h, mask, 1);
if( CKR_OK != ck_rv ) {
PR_fprintf(PR_STDERR, "C_FindObjectsInit(%lu, mask, 1) returned 0x%08x\n",
h, ck_rv);
return 1;
}
(void)memset(&found, 0, sizeof(found));
nFound = 0;
ck_rv = epv->C_FindObjects(h, found, 10, &nFound);
if( CKR_OK != ck_rv ) {
PR_fprintf(PR_STDERR, "C_FindObjects(%lu,, 10, ) returned 0x%08x\n",
h, ck_rv);
return 1;
}
if( 4 != nFound ) {
PR_fprintf(PR_STDERR, "Found %lu objects, not 4.\n", nFound);
return 1;
}