CK_OBJECT_HANDLE certHandle = CK_INVALID_HANDLE;
CERTCertificate *cert = NULL;
pk11_AllFindCertObjectByRecipientNew(NSSCMSRecipient **recipientlist, void *wincx, int *rlIndex){    PK11SlotList *list;    PK11SlotListElement *le;    CK_OBJECT_HANDLE certHandle = CK_INVALID_HANDLE;    SECStatus rv;    /* get them all! */    list = PK11_GetAllTokens(CKM_INVALID_MECHANISM,PR_FALSE,PR_TRUE,wincx);    if (list == NULL) {	if (list) PK11_FreeSlotList(list);    	return CK_INVALID_HANDLE;    }    /* Look for the slot that holds the Key */    for (le = list->head ; le; le = le->next) {	if ( !PK11_IsFriendly(le->slot)) {	    rv = PK11_Authenticate(le->slot, PR_TRUE, wincx);	    if (rv != SECSuccess) continue;	}	certHandle = pk11_FindCertObjectByRecipientNew(le->slot, recipientlist, rlIndex);	if (certHandle != CK_INVALID_HANDLE)	    break;    }    PK11_FreeSlotList(list);    return (le == NULL) ? CK_INVALID_HANDLE : certHandle;}