SECU_RegisterDynamicOids();
int main(int argc, char **argv){    int o, changePassword, deleteKey, dumpPublicKey, dumpPrivateKey, list;    char *nickname;    SECStatus rv;    SECKEYKeyDBHandle *keyHandle;    progName = strrchr(argv[0], '/');    progName = progName ? progName+1 : argv[0];    /* Parse command line arguments */    changePassword = deleteKey = dumpPublicKey = dumpPrivateKey = list = 0;    nickname = NULL;    while ((o = getopt(argc, argv, "ADP:cd:glp:")) != -1) {	switch (o) {	  case '?':	    Usage(progName);	    break;	  case 'A':	    fprintf(stderr, "%s: Can no longer add a key.", progName);	    fprintf(stderr, " Use pkcs12 to import a key.\n\n");	    Usage(progName);	    break;	  case 'D':	    deleteKey = 1;	    nickname = optarg;	    break;	  case 'P':	    dumpPrivateKey = 1;	    nickname = optarg;	    break;	  case 'c':	    changePassword = 1;	    break;	  case 'd':	    SECU_ConfigDirectory(optarg);	    break;	  case 'g':	    fprintf(stderr, "%s: Can no longer generate a key.", progName);	    fprintf(stderr, " Use certutil to generate a cert request.\n\n");	    Usage(progName);	    break;	  case 'l':	    list = 1;	    break;	  case 'p':	    dumpPublicKey = 1;	    nickname = optarg;	    break;	}    }    if (dumpPublicKey+changePassword+dumpPrivateKey+list+deleteKey != 1)	Usage(progName);    if ((list || changePassword) && nickname)	Usage(progName);    if ((dumpPublicKey || dumpPrivateKey || deleteKey) && !nickname)	Usage(progName);    /* Call the libsec initialization routines */    PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);    SEC_Init();    /*     * XXX Note that the following opens the key database writable.     * If dumpPublicKey or dumpPrivateKey or list, though, we only want     * to open it read-only.  There needs to be a better interface     * to the initialization routines so that we can specify which way     * to open it.     */    rv = SECU_PKCS11Init();    if (rv != SECSuccess) {        SECU_PrintError(progName, "SECU_PKCS11Init failed");	return -1;    }    keyHandle = SECKEY_GetDefaultKeyDB();    if (keyHandle == NULL) {        SECU_PrintError(progName, "could not open key database");	return -1;    }    if (dumpPublicKey) {	rv = DumpPublicKey(keyHandle, nickname, stdout);    } else    if (changePassword) {	rv = ChangePassword(keyHandle);    } else    if (dumpPrivateKey) {	rv = DumpPrivateKey(keyHandle, nickname, stdout);    } else    if (list) {	rv = ListKeys(keyHandle, stdout);    } else    if (deleteKey) {	rv = DeletePrivateKey(keyHandle, nickname);    }        return rv ? -1 : 0;}