if (!cert->nickname) continue; if (nssUTF8_Equal(cert->nickname, nickname, &nssrv)) {
NSSUTF8 *tokenNick = NSSCertificate_GetNickname(cert, token); if (!tokenNick) continue; if (nssUTF8_Equal(tokenNick, nickname, &nssrv)) {
filter_token_certs_nickname(NSSToken *token, NSSUTF8 *nickname){    nssListIterator *certs;    NSSCertificate *cert;    PRStatus nssrv;    nssList *rvList;    certs = nssList_CreateIterator(token->certList);    if (!certs) return NULL;    rvList = nssList_Create(NULL, PR_FALSE);    if (!rvList) {	nssListIterator_Destroy(certs);	return NULL;    }    for (cert  = (NSSCertificate *)nssListIterator_Start(certs);         cert != (NSSCertificate *)NULL;         cert  = (NSSCertificate *)nssListIterator_Next(certs))    {	if (!cert->nickname) continue;	if (nssUTF8_Equal(cert->nickname, nickname, &nssrv)) {	    nssList_Add(rvList, nssCertificate_AddRef(cert));	}    }    nssListIterator_Finish(certs);    nssListIterator_Destroy(certs);    if (nssList_Count(rvList) == 0) {	nssList_Destroy(rvList);	rvList = NULL;    }    return rvList;}