i am using a certificate generated by makecert which has both private and public key. The java side uses this public key to encrypt the data and .net decrypts it back.
I finally found the problem. I wasn't putting the key to makecert to define it as RSA Crypto key.