certObject = JSS_PK11_wrapCert(env, &cert);
certObject = JSS_PK11_wrapCertAndSlot(env, &cert, &slot);
Java_org_mozilla_jss_CryptoManager_findCertByIssuerAndSerialNumberNative  (JNIEnv *env, jobject this, jbyteArray issuerBA, jbyteArray serialNumBA){    jobject certObject=NULL;    CERTCertificate *cert=NULL;    SECItem *issuer=NULL, *serialNum=NULL;    CERTIssuerAndSN issuerAndSN;    PK11SlotInfo *slot=NULL;    PR_ASSERT(env!=NULL && this!=NULL);    /* validate args */    if( issuerBA == NULL || serialNumBA == NULL ) {        JSS_throwMsg(env, ILLEGAL_ARGUMENT_EXCEPTION,            "NULL parameter passed to CryptoManager.findCertByIssuer"            "AndSerialNumberNative");        goto finish;    }    /* convert byte arrays to SECItems */    issuer = JSS_ByteArrayToSECItem(env, issuerBA);    if( issuer == NULL ) {        goto finish; }    serialNum = JSS_ByteArrayToSECItem(env, serialNumBA);    if( serialNum == NULL ) {        goto finish; }    issuerAndSN.derIssuer = *issuer;    issuerAndSN.serialNumber = *serialNum;    /* lookup with PKCS #11 first, then use cert database */    cert = PK11_FindCertByIssuerAndSN(&slot, &issuerAndSN, NULL /*wincx*/);    if( cert == NULL ) {        cert = CERT_FindCertByIssuerAndSN(                        CERT_GetDefaultCertDB(),                        &issuerAndSN);        if( cert == NULL ) {            JSS_nativeThrow(env, OBJECT_NOT_FOUND_EXCEPTION);            goto finish;        }    }    certObject = JSS_PK11_wrapCert(env, &cert);finish:    if(slot) {        PK11_FreeSlot(slot);    }    if(cert != NULL) {        CERT_DestroyCertificate(cert);    }    if(issuer) {        SECITEM_FreeItem(issuer, PR_TRUE /*freeit*/);    }    if(serialNum) {        SECITEM_FreeItem(serialNum, PR_TRUE /*freeit*/);    }    return certObject;}