<div dir="ltr"><div>reading page 136 of the pkcs11 specs, i read that i setup a template with attributes to <br></div><div>match in a following C_FindObjects.<br><br></div><div>please consider this template where i load 6 attribtes, 0 - 5.<br>
</div><div><br> CK_ATTRIBUTE Template[] = {<br> {CKA_CLASS, &data_class, sizeof(CK_OBJECT_CLASS)},<br> {CKA_APPLICATION, (void *)"Application", sizeof("Application") -1},<br> {CKA_LABEL, (void *)"card_data", sizeof("card_data" -1) },<br>
{CKA_PRIVATE, &bPinCodeProtected, sizeof(CK_BBOOL)},<br> {CKA_TOKEN, &bTrue, sizeof(CK_BBOOL)},<br> {CKA_VALUE, card_data, sizeof(card_data_t)}<br> };<br><br><br> CK_ULONG ulCount = sizeof(Template) / sizeof(CK_ATTRIBUTE);<br>
<br></div><br><div> Template[ulCount - 1].ulValueLen = sizeof(card_data_t);<br><br> printf( "C_FindObjects [%ld] ul=%ld sz=%ld\n" , ulCount - 1, Template[ulCount - 1].ulValueLen);<br><br><b> rv = C_FindObjectsInit( g_session, Template, ulCount - 1);</b><br>
<br><div>i compute 6 elements total, But then in the C_FindObjectsInit, i pass ulCount - 1<br></div><div>and i get no matches.<br><br></div><div>should i be doing <br><b><br> rv = C_FindObjectsInit( g_session, Template, ulCount );</b><br>
</div><br>am i doing this wrong? Tia, jackc<br></div><br><br></div>