char *progName;
int main(int argc, char **argv){    SECItem privKeyDER;    CERTCertDBHandle *certHandle;    FILE *certFile;    PRFileDesc *inFile;    int listCRL;    int importCRL;    int opt;    int deleteCRL;    int rv;    char *nickName;    char *progName;    char *url;    int crlType;    PLOptState *optstate;    PLOptStatus status;    SECStatus secstatus;    progName = strrchr(argv[0], '/');    progName = progName ? progName+1 : argv[0];    rv = 0;    deleteCRL = importCRL = listCRL = 0;    certFile = NULL;    inFile = NULL;    nickName = url = NULL;    privKeyDER.data = NULL;    certHandle = NULL;    crlType = SEC_CRL_TYPE;    /*     * Parse command line arguments     */    optstate = PL_CreateOptState(argc, argv, "IALd:i:Dn:Ct:u:");    while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {	switch (optstate->option) {	  case '?':	    Usage(progName);	    break;	  case 'C':	      listCRL = 1;	      break;	  case 'D':	      deleteCRL = 1;	      break;	  case 'I':	      importCRL = 1;	      break;	           	  case 'L':	      listCRL = 1;	      break;	           	  case 'd':	    SECU_ConfigDirectory(optstate->value);	    break;	  case 'i':	    inFile = PR_Open(optstate->value, PR_RDONLY, 0);	    if (!inFile) {		fprintf(stderr, "%s: unable to open \"%s\" for reading\n",			progName, optstate->value);		return -1;	    }	    break;	    	  case 'n':	    nickName = strdup(optstate->value);	    break;	    	  case 'u':	    url = strdup(optstate->value);	    break;	  case 't': {	    char *type;	    	    type = strdup(optstate->value);	    crlType = atoi (type);	    if (crlType != SEC_CRL_TYPE && crlType != SEC_KRL_TYPE) {		fprintf(stderr, "%s: invalid crl type\n", progName);		return -1;	    }	    break;          }	}    }    if (deleteCRL && !nickName) Usage (progName);    if (!(listCRL || deleteCRL || importCRL)) Usage (progName);    if (importCRL && !inFile) Usage (progName);        PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);    secstatus = NSS_InitReadWrite(SECU_ConfigDirectory(NULL));    if (secstatus != SECSuccess) {	SECU_PrintPRandOSError(progName);	return -1;    }    certHandle = CERT_GetDefaultCertDB();    if (certHandle == NULL) {	SECU_PrintError(progName, "unable to open the cert db");	    		return (-1);    }    /* Read in the private key info */    if (deleteCRL) 	DeleteCRL (certHandle, nickName, crlType);    else if (listCRL)	ListCRL (certHandle, nickName, crlType);    else if (importCRL) 	rv = ImportCRL (certHandle, url, crlType, inFile);        return (rv);}