filter_list_for_token_certs(certList, tok);
PK11_TraverseCertsInSlot(PK11SlotInfo *slot,	SECStatus(* callback)(CERTCertificate*, void *), void *arg){#ifdef NSS_CLASSIC    pk11DoCertCallback caller;    pk11TraverseSlot callarg;    CK_OBJECT_CLASS certClass = CKO_CERTIFICATE;    CK_ATTRIBUTE theTemplate[] = {	{ CKA_CLASS, NULL, 0 },    };    CK_ATTRIBUTE *attr = theTemplate;    int templateSize = sizeof(theTemplate)/sizeof(theTemplate[0]);    PK11_SETATTRS(attr,CKA_CLASS, &certClass, sizeof(certClass)); attr++;    if (slot == NULL) {	return SECSuccess;    }    caller.noslotcallback = callback;    caller.callback = NULL;    caller.itemcallback = NULL;    caller.callbackArg = arg;    callarg.callback = pk11_DoCerts;    callarg.callbackArg = (void *) & caller;    callarg.findTemplate = theTemplate;    callarg.templateCount = templateSize;    return PK11_TraverseSlot(slot, &callarg);#else    PRStatus nssrv;    NSSTrustDomain *td = STAN_GetDefaultTrustDomain();    struct nss3_cert_cbstr pk11cb;    NSSToken *tok;    nssList *certList = NULL;    nssTokenCertSearch search;    pk11cb.callback = callback;    pk11cb.arg = arg;    tok = PK11Slot_GetNSSToken(slot);    if (!nssToken_SearchCerts(tok, NULL)) {	certList = tok->certList;	nssrv = nssCertificateList_DoCallback(certList, convert_cert, &pk11cb);    } else {	certList = nssList_Create(NULL, PR_FALSE);	if (!certList) {	    return SECFailure;	}	(void *)nssTrustDomain_GetCertsFromCache(td, certList);	filter_list_for_token_certs(certList, tok);	/* set the search criteria */	search.callback = convert_and_cache_cert;	search.cbarg = &pk11cb;	search.cached = certList;	search.searchType = nssTokenSearchType_TokenOnly;	pk11cb.cached = certList;	nssrv = nssCertificateList_DoCallback(certList, 	                                      convert_cert, &pk11cb);	if (nssrv == PR_SUCCESS) {	    nssrv = nssToken_TraverseCertificates(tok, NULL, &search);	}	nssList_Clear(certList, cert_destructor);	nssList_Destroy(certList);    }    return (nssrv == PR_SUCCESS) ? SECSuccess : SECFailure;#endif}