NSS_Shutdown();
if (NSS_Shutdown() != SECSuccess) { exit(1); }
main(int argc, char **argv){    PRIntn ret = 0;    secuPWData slotPw = { PW_NONE, NULL };    secuPWData p12FilePw = { PW_NONE, NULL };    PK11SlotInfo *slot;    char *slotname = NULL;    char *import_file = NULL;    char *export_file = NULL;    char *dbprefix = "";    SECStatus rv;    secuCommand pk12util;    pk12util.numCommands = 0;    pk12util.commands = 0;    pk12util.numOptions = sizeof(pk12util_options) / sizeof(secuCommandFlag);    pk12util.options = pk12util_options;    progName = strrchr(argv[0], '/');    progName = progName ? progName+1 : argv[0];    rv = SECU_ParseCommandLine(argc, argv, progName, &pk12util);    if (rv != SECSuccess)	Usage(progName);    pk12_debugging = pk12util.options[opt_Debug].activated;    if (pk12util.options[opt_Import].activated &&	pk12util.options[opt_Export].activated) {	Usage(progName);    }    if (pk12util.options[opt_Export].activated &&       !pk12util.options[opt_Nickname].activated) {	Usage(progName);    }    slotname = SECU_GetOptionArg(&pk12util, opt_TokenName);    import_file = SECU_GetOptionArg(&pk12util, opt_Import);    export_file = SECU_GetOptionArg(&pk12util, opt_Export);    if (pk12util.options[opt_P12FilePWFile].activated) {	p12FilePw.source = PW_FROMFILE;	p12FilePw.data = PL_strdup(pk12util.options[opt_P12FilePWFile].arg);    }    if (pk12util.options[opt_P12FilePW].activated) {	p12FilePw.source = PW_PLAINTEXT;	p12FilePw.data = PL_strdup(pk12util.options[opt_P12FilePW].arg);    }    if (pk12util.options[opt_SlotPWFile].activated) {	slotPw.source = PW_FROMFILE;	slotPw.data = PL_strdup(pk12util.options[opt_SlotPWFile].arg);    }    if (pk12util.options[opt_SlotPW].activated) {	slotPw.source = PW_PLAINTEXT;	slotPw.data = PL_strdup(pk12util.options[opt_SlotPW].arg);    }    if (pk12util.options[opt_CertDir].activated) {	SECU_ConfigDirectory(pk12util.options[opt_CertDir].arg);    }    if (pk12util.options[opt_DBPrefix].activated) {    	dbprefix = pk12util.options[opt_DBPrefix].arg;    }    P12U_Init(SECU_ConfigDirectory(NULL),dbprefix);    if (!slotname || PL_strcmp(slotname, "internal") == 0)	slot = PK11_GetInternalKeySlot();    else	slot = PK11_FindSlotByName(slotname);    if (!slot) {	SECU_PrintError(progName,"Invalid slot \"%s\"", slotname);	pk12uErrno = PK12UERR_PK11GETSLOT;	goto done;    }    if (pk12util.options[opt_Import].activated) {	if ((ret = P12U_ImportPKCS12Object(import_file, slot, &slotPw,					   &p12FilePw)) != 0)	    goto done;    } else if (pk12util.options[opt_Export].activated) {	P12U_ExportPKCS12Object(pk12util.options[opt_Nickname].arg,				export_file, slot, &slotPw, &p12FilePw);    } else {	Usage(progName);	pk12uErrno = PK12UERR_USAGE;    }done:    if (slot) PK11_FreeSlot(slot);    NSS_Shutdown();    exit(pk12uErrno);}