object = JSS_PK11_wrapCertAndSlot(env, &certCopy, &slotCopy);
object = JSS_PK11_wrapCertAndSlotAndNickname(env, &certCopy, &slotCopy, node->appData);
Java_org_mozilla_jss_pkcs11_PK11Store_putCertsInVector    (JNIEnv *env, jobject this, jobject certVector){    PK11SlotInfo *slot;    PK11SlotInfo *slotCopy;    jclass vectorClass;    jmethodID addElement;    CERTCertList *certList = NULL;    CERTCertificate *certCopy;    CERTCertListNode *node = NULL;    jobject object;    PR_ASSERT(env!=NULL && this!=NULL && certVector!=NULL);    if( JSS_PK11_getStoreSlotPtr(env, this, &slot) != PR_SUCCESS) {        ASSERT_OUTOFMEM(env);        goto finish;    }    PR_ASSERT(slot!=NULL);    /*     * log in if the slot does not have publicly readable certs     */    if( !PK11_IsFriendly(slot) ) {        PK11_Authenticate(slot, PR_TRUE /*load certs*/, NULL /*wincx*/);    }    certList = PK11_ListCertsInSlot(slot);    if( certList == NULL ) {        JSS_throwMsg(env, TOKEN_EXCEPTION, "PK11_ListCertsInSlot "            "returned an error");        goto finish;    }    /**************************************************     * Get JNI ids     **************************************************/    vectorClass = (*env)->GetObjectClass(env, certVector);    if(vectorClass == NULL) {        ASSERT_OUTOFMEM(env);        goto finish;    }    addElement = (*env)->GetMethodID(env,                                     vectorClass,                                     VECTOR_ADD_ELEMENT_NAME,                                     VECTOR_ADD_ELEMENT_SIG);    if(addElement == NULL) {        ASSERT_OUTOFMEM(env);        goto finish;    }    for(    node = CERT_LIST_HEAD(certList);            !CERT_LIST_END(node, certList);            node = CERT_LIST_NEXT(node) )    {        /***************************************************        * Wrap the object        ***************************************************/        certCopy = CERT_DupCertificate(node->cert);        slotCopy = PK11_ReferenceSlot(slot);        object = JSS_PK11_wrapCertAndSlot(env, &certCopy, &slotCopy);        if(object == NULL) {            PR_ASSERT( (*env)->ExceptionOccurred(env) );            goto finish;        }        /***************************************************        * Insert the cert into the vector        ***************************************************/        (*env)->CallVoidMethod(env, certVector, addElement, object);    }finish:    if( certList != NULL ) {        CERT_DestroyCertList(certList);    }    return;}