{ CKA_CLASS, g_ck_class_cert.data, g_ck_class_cert.size }, { CKA_LABEL, NULL,                 0                    }
{ CKA_CLASS, NULL, 0 }, { CKA_LABEL, NULL, 0 }
NSSTrustDomain_FindCertificatesByNickname(  NSSTrustDomain *td,  NSSUTF8 *name,  NSSCertificate *rvOpt[],  PRUint32 maximumOpt, /* 0 for no max */  NSSArena *arenaOpt){    PRStatus nssrv;    PRUint32 count;    NSSCertificate **certs;    NSSToken *tok;    nssList *foundCerts;    CK_ATTRIBUTE cert_template[] =    {	{ CKA_CLASS, g_ck_class_cert.data, g_ck_class_cert.size },	{ CKA_LABEL, NULL,                 0                    }    };    struct collect_arg_str ca;    CK_ULONG ctsize;    ctsize = (CK_ULONG)(sizeof(cert_template) / sizeof(cert_template[0]));    cert_template[1].pValue = (CK_VOID_PTR)name;    cert_template[1].ulValueLen = (CK_ULONG)nssUTF8_Length(name, &nssrv);    foundCerts = nssList_Create(NULL, PR_FALSE);    ca.list = foundCerts;    ca.maximum = maximumOpt;    ca.arena = arenaOpt;    /* This will really be done through the search order, probably a     * token array     */    for (tok  = (NSSToken *)nssListIterator_Start(td->tokens);         tok != (NSSToken *)NULL;         tok  = (NSSToken *)nssListIterator_Next(td->tokens))    {	nssrv = nssToken_FindCertificatesByTemplate(tok, NULL, 	                                            cert_template, ctsize,                                                    collect_certs, &ca);	/* This is to workaround the fact that PKCS#11 doesn't specify	* whether the '\0' should be included.  XXX Is that still true?	*/	cert_template[1].ulValueLen++;	nssrv = nssToken_FindCertificatesByTemplate(tok, NULL, 	                                            cert_template, ctsize,                                                    collect_certs, &ca);	cert_template[1].ulValueLen--;    }    nssListIterator_Finish(td->tokens);    count = nssList_Count(foundCerts);    if (rvOpt) {	certs = rvOpt;    } else {	certs = nss_ZNEWARRAY(arenaOpt, NSSCertificate *, count + 1);    }    nssrv = nssList_GetArray(foundCerts, (void **)certs, count);    nssList_Destroy(foundCerts);    return certs;}