SECStatus rv;
DumpChain(CERTCertDBHandle *handle, char *name){    SECStatus rv;    CERTCertificate *the_cert;    CERTCertificateList *chain;    int i, j;    the_cert = PK11_FindCertFromNickname(name, NULL);    if (!the_cert) {	SECU_PrintError(progName, "Could not find: %s\n", name);	return SECFailure;    }    chain = CERT_CertChainFromCert(the_cert, 0, PR_TRUE);    CERT_DestroyCertificate(the_cert);    if (!chain) {	SECU_PrintError(progName, "Could not obtain chain for: %s\n", name);	return SECFailure;    }    for (i=chain->len-1; i>=0; i--) {	CERTCertificate *c;	c = CERT_FindCertByDERCert(handle, &chain->certs[i]);	for (j=i; j<chain->len-1; j++) printf("  ");	printf("\"%s\" [%s]\n\n", c->nickname, c->subjectName);	CERT_DestroyCertificate(c);    }    CERT_DestroyCertificateList(chain);    return SECSuccess;}