nssListIterator *certs; NSSCertificate *cert; PRBool removeIt; certs = nssList_CreateIterator(certList); for (cert  = (NSSCertificate *)nssListIterator_Start(certs); cert != (NSSCertificate *)NULL; cert  = (NSSCertificate *)nssListIterator_Next(certs)) { removeIt = instance_destructor(cert, token); if (removeIt) { nssList_Remove(certList, cert); CERT_DestroyCertificate(STAN_GetCERTCertificate(cert)); } } nssListIterator_Finish(certs); nssListIterator_Destroy(certs);
destroy_token_certs(certList, token, PR_FALSE);
nssCertificateList_DestroyTokenCerts(nssList *certList, NSSToken *token){    nssListIterator *certs;    NSSCertificate *cert;    PRBool removeIt;    certs = nssList_CreateIterator(certList);    for (cert  = (NSSCertificate *)nssListIterator_Start(certs);         cert != (NSSCertificate *)NULL;         cert  = (NSSCertificate *)nssListIterator_Next(certs))    {	removeIt = instance_destructor(cert, token);	if (removeIt) {	    nssList_Remove(certList, cert);	    CERT_DestroyCertificate(STAN_GetCERTCertificate(cert));	}    }    nssListIterator_Finish(certs);    nssListIterator_Destroy(certs);}