<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div> {CKA_LABEL, (void *)"card_data", sizeof("card_data" -1) },<br></div></div></blockquote><div><br></div><div>Maybe just a typo in the email, but the -1 should be outside the parentheses.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div></div><div><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</div></div></blockquote><div><br></div><div>The indexing of the array goes from 0 to 5. But when you count the content of the array then it goes from 1 to 6. So ulCount should be equal to 6.</div>
<div><br></div><div>However, you should get a match with just 5 attributes. The extra attribute will just narrow the search. Is the object a private object? Then you also need to C_Login() on your session before searching.</div>
<div><br></div><div>When searching for objects you usually just search using the CKA_CLASS and CKA_ID. E.g. a private key with ID 1234. </div><div><br></div><div>This is the code that OpenDNSSEC uses when searching for objects.</div>
<div><a href="http://fisheye.opendnssec.org/browse/~br=trunk/opendnssec/trunk/OpenDNSSEC/libhsm/src/lib/libhsm.c?hb=true#to1132">http://fisheye.opendnssec.org/browse/~br=trunk/opendnssec/trunk/OpenDNSSEC/libhsm/src/lib/libhsm.c?hb=true#to1132</a><br>
</div><div><br></div><div>// Rickard</div></div></div></div>