nssrv = nssToken_TraverseCertificatesBySubject(token, NULL, subject, &search);
if (nssToken_SearchCerts(token)) { nssrv = nssToken_TraverseCertificatesBySubject(token, NULL, subject, &search); }
NSSTrustDomain_FindBestCertificateBySubject(  NSSTrustDomain *td,  NSSDER *subject,  NSSTime *timeOpt,  NSSUsage *usage,  NSSPolicies *policiesOpt){    PRStatus nssrv;    NSSToken *token;    nssList *subjectList;    nssBestCertificateCB best;    nssTokenCertSearch search;    /* set the criteria for determining the best cert */    nssBestCertificate_SetArgs(&best, timeOpt, usage, policiesOpt);    /* find all matching certs in the cache */    subjectList = nssList_Create(NULL, PR_FALSE);    (void)nssTrustDomain_GetCertsForSubjectFromCache(td, subject, subjectList);    /* set the search criteria */    search.callback = nssBestCertificate_Callback;    search.cbarg = &best;    search.cached = subjectList;    search.searchType = nssTokenSearchType_TokenOnly;    /* traverse the tokens */    for (token  = (NSSToken *)nssListIterator_Start(td->tokens);         token != (NSSToken *)NULL;         token  = (NSSToken *)nssListIterator_Next(td->tokens))    {	nssrv = nssToken_TraverseCertificatesBySubject(token, NULL, 	                                               subject, &search);    }    nssListIterator_Finish(td->tokens);    nssList_Clear(subjectList, cert_destructor);    nssList_Destroy(subjectList);    if (best.cert) {	nssTrustDomain_AddCertsToCache(td, &best.cert, 1);    }    return best.cert;}