certClass = (*env)->FindClass(env, INTERNAL_CERT_CLASS_NAME);
certClass = (*env)->FindClass(env, X509_CERT_CLASS);
getCerts(JNIEnv *env, PK11CertListType type){    jobjectArray certArray = NULL;    jclass certClass;    jobject certObject;    CERTCertList *certList = NULL;    CERTCertListNode *node;    int numCerts, i;    certList = PK11_ListCerts(type, NULL);    if( certList == NULL ) {        JSS_throwMsg(env, TOKEN_EXCEPTION, "Unable to list certificates");        goto finish;    }    /* first count the damn certs */    numCerts = 0;    for( node = CERT_LIST_HEAD(certList); ! CERT_LIST_END(node, certList);            node = CERT_LIST_NEXT(node) ) {        ++numCerts;    }    /**************************************************     * Create array of Java certificates     **************************************************/    certClass = (*env)->FindClass(env, INTERNAL_CERT_CLASS_NAME);    if(certClass == NULL) {        ASSERT_OUTOFMEM(env);        goto finish;    }    certArray = (*env)->NewObjectArray( env,                                        numCerts,                                        certClass,                                        NULL );    if( certArray == NULL ) {        ASSERT_OUTOFMEM(env);        goto finish;    }    PR_ASSERT( (*env)->ExceptionOccurred(env) == NULL );    /**************************************************     * Put all the certs in the array     **************************************************/    i = 0;    for( node = CERT_LIST_HEAD(certList); ! CERT_LIST_END(node, certList);            node = CERT_LIST_NEXT(node) ) {        PR_ASSERT( i < numCerts );        certObject = JSS_PK11_wrapCert(env, &(node->cert));        if( certObject == NULL ) {            goto finish;        }        (*env)->SetObjectArrayElement(env, certArray, i, certObject);        if( (*env)->ExceptionOccurred(env) ) {            goto finish;        }        ++i;    }    PR_ASSERT( i == numCerts );finish:    if( certList != NULL ) {        CERT_DestroyCertList(certList);    }    return certArray;}