privKey = PK11_FindKeyByAnyCert(cert, NULL);
privKey = PK11_FindPrivateKeyFromCert(slot, cert, NULL);
Java_org_mozilla_jss_ssl_SSLServerSocket_setServerCert(    JNIEnv *env, jobject self, jobject certObj){    JSSL_SocketData *sock;    CERTCertificate* cert=NULL;    SECKEYPrivateKey* privKey=NULL;    SECStatus status;    if( certObj == NULL ) {        JSS_throw(env, NULL_POINTER_EXCEPTION);        goto finish;    }    if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS) goto finish;    if( JSS_PK11_getCertPtr(env, certObj, &cert) != PR_SUCCESS ) {        goto finish;    }    PR_ASSERT(cert!=NULL); /* shouldn't happen */    privKey = PK11_FindKeyByAnyCert(cert, NULL);    if (privKey != NULL) {        status = SSL_ConfigSecureServer(sock->fd, cert, privKey, kt_rsa);        if( status != SECSuccess) {            JSSL_throwSSLSocketException(env,                "Failed to configure secure server certificate and key");            goto finish;        }    } else {        JSSL_throwSSLSocketException(env, "Failed to locate private key");        goto finish;    }finish:    if(privKey!=NULL) {        SECKEY_DestroyPrivateKey(privKey);    }}