privKey = PK11_FindKeyByAnyCert(cert, NULL);
privKey = PK11_FindPrivateKeyFromCert(slot, cert, NULL);
Java_org_mozilla_jss_CryptoManager_findPrivKeyByCertNative  (JNIEnv *env, jobject this, jobject Cert){    PRThread *pThread;    CERTCertificate *cert;    SECKEYPrivateKey *privKey=NULL;    jobject Key = NULL;    pThread = PR_AttachThread(PR_SYSTEM_THREAD, 0, NULL);    PR_ASSERT( pThread != NULL);    PR_ASSERT( env!=NULL && this!=NULL && Cert!=NULL);    if( JSS_PK11_getCertPtr(env, Cert, &cert) != PR_SUCCESS) {        PR_ASSERT( (*env)->ExceptionOccurred(env) != NULL);        goto finish;    }    if(cert==NULL) {        PR_ASSERT(PR_FALSE);        JSS_throw(env, OBJECT_NOT_FOUND_EXCEPTION);        goto finish;    }    privKey = PK11_FindKeyByAnyCert(cert, NULL);    if(privKey == NULL) {        JSS_throw(env, OBJECT_NOT_FOUND_EXCEPTION);        goto finish;    }    Key = JSS_PK11_wrapPrivKey(env, &privKey);finish:    if(privKey != NULL) {        SECKEY_DestroyPrivateKey(privKey);    }    PR_DetachThread();    return Key;}