install_cert(CERTCertDBHandle *db, PK11SlotInfo *slot, SECItem *derCert, char *nickname)
install_cert(CERTCertDBHandle *db, SECItem *derCert, char *nickname)
install_cert(CERTCertDBHandle *db, PK11SlotInfo *slot, SECItem *derCert,        char *nickname){	CERTCertificate *newcert;	CERTCertTrust trust;    PK11SlotInfo *newSlot;	newcert = CERT_DecodeDERCertificate(derCert, PR_TRUE, NULL);	if (newcert == NULL) {		PR_fprintf(errorFD, "%s: can't create new certificate\n", PROGRAM_NAME);		errorCount++;		exit (ERRX);	}    newSlot = PK11_ImportCertForKey(newcert, nickname, NULL /*wincx*/);    if( slot == NULL ) {        PR_fprintf(errorFD, "Unable to install certificate\n");        errorCount++;        exit(ERRX);    }	PORT_Memset ((void *) &trust, 0, sizeof(trust));	trust.objectSigningFlags |= CERTDB_USER;    if( newSlot == PK11_GetInternalKeySlot() ) {        /* newcert is now a permanent cert */        if( CERT_ChangeCertTrust(db, newcert, &trust) != SECSuccess) {            PR_fprintf(errorFD,                "Failed to change trust of generated certificate\n");            errorCount++;            exit(ERRX);        }    } else {	    if (CERT_AddTempCertToPerm (newcert, nickname, &trust) != SECSuccess) {		    PR_fprintf(errorFD, "%s: Failure adding \"%s\" certificate to "		        "permanent DB\n", PROGRAM_NAME, nickname);		    errorCount++;		    exit (ERRX);	    }     }    if(verbosity >= 0){	   PR_fprintf(outputFD, "certificate \"%s\" added to database\n", nickname);	}	return newcert;}