result = JSS_PK11_wrapCert(env, &certArray[0]);
slot = PK11_GetInternalKeySlot();   result = JSS_PK11_wrapCertAndSlot(env, &certArray[0], &slot);
Java_org_mozilla_jss_CryptoManager_importCertToPermNative    (JNIEnv *env, jobject this, jobject cert, jstring nickString){    SECStatus rv;    CERTCertificate *oldCert;    jobject          result=NULL;    char *nickname=NULL;    CERTCertificate **certArray = NULL;    SECItem *derCertArray[1];    /* first, get the NSS cert pointer from the 'cert' object */    if ( JSS_PK11_getCertPtr(env, cert, &oldCert) != PR_SUCCESS) {        PR_ASSERT( (*env)->ExceptionOccurred(env) != NULL);        goto finish;    }    PR_ASSERT(oldCert != NULL);    if (nickString != NULL) {        nickname = (char*) (*env)->GetStringUTFChars(env, nickString, NULL);    }    /* Then, add to permanent database */    derCertArray[0] = &oldCert->derCert;    rv = CERT_ImportCerts(CERT_GetDefaultCertDB(), -1 /* usage */,            1, derCertArray, &certArray, PR_TRUE /*keepCerts*/,            PR_FALSE /*caOnly*/, nickname);    if( rv != SECSuccess || certArray == NULL || certArray[0] == NULL) {        JSS_throwMsg(env, TOKEN_EXCEPTION, "Unable to insert certificate"                " into permanent database");        goto finish;    }    result = JSS_PK11_wrapCert(env, &certArray[0]);finish:    /* this checks for NULL */    CERT_DestroyCertArray(certArray, 1);    if (nickname != NULL) {        (*env)->ReleaseStringUTFChars(env, nickString, nickname);    }    return result;}