Cryptoki: a cryptographic Token Interface



Download 360.55 Kb.
Page100/196
Date22.12.2023
Size360.55 Kb.
#63026
1   ...   96   97   98   99   100   101   102   103   ...   196
v201-95
pkcs11-base-v2.40-cos01

C_FindObjects


CK_DEFINE_FUNCTION(CK_RV, C_FindObjects)(
CK_SESSION_HANDLE hSession,
CK_OBJECT_HANDLE_PTR phObject,
CK_ULONG ulMaxObjectCount,
CK_ULONG_PTR pulObjectCount
);
C_FindObjects continues a search for token and session objects that match a template, obtaining additional object handles. hSession is the session’s handle; phObject points to the location that receives the list (array) of additional object handles; ulMaxObjectCount is the maximum number of object handles to be returned; pulObjectCount points to the location that receives the actual number of object handles returned.
If there are no more objects matching the template, then the location that pulObjectCount points to receives the value 0.
The search must have been initialized with C_FindObjectsInit.
Return values: CKR_CRYPTOKI_NOT_INITIALIZED, CKR_DEVICE_ERROR, CKR_DEVICE_MEMORY, CKR_DEVICE_REMOVED, CKR_FUNCTION_FAILED, CKR_GENERAL_ERROR, CKR_HOST_MEMORY, CKR_OK, CKR_OPERATION_NOT_INITIALIZED, CKR_SESSION_CLOSED, CKR_SESSION_HANDLE_INVALID.
Example: see C_FindObjectsFinal.
  • C_FindObjectsFinal


CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsFinal)(
CK_SESSION_HANDLE hSession
);
C_FindObjectsFinal terminates a search for token and session objects. hSession is the session’s handle.
Return values: CKR_CRYPTOKI_NOT_INITIALIZED, CKR_DEVICE_ERROR, CKR_DEVICE_MEMORY, CKR_DEVICE_REMOVED, CKR_FUNCTION_FAILED, CKR_GENERAL_ERROR, CKR_HOST_MEMORY, CKR_OK, CKR_OPERATION_NOT_INITIALIZED, CKR_SESSION_CLOSED, CKR_SESSION_HANDLE_INVALID.
Example:
CK_SESSION_HANDLE hSession;
CK_OBJECT_HANDLE hObject;
CK_ULONG ulObjectCount;
CK_RV rv;

.
.
.


rv = C_FindObjectsInit(hSession, NULL_PTR, 0);
assert(rv == CKR_OK);
while (1) {
rv = C_FindObjects(hSession, &hObject, 1, &ulObjectCount);
if (rv != CKR_OK || ulObjectCount == 0)
break;
.
.
.
}

rv = C_FindObjectsFinal(hSession);


assert(rv == CKR_OK);

Download 360.55 Kb.

Share with your friends:
1   ...   96   97   98   99   100   101   102   103   ...   196




The database is protected by copyright ©ininet.org 2024
send message

    Main page