rsacryptoserviceprovider using x509 certificates c#

前端 未结 4 1860
失恋的感觉
失恋的感觉 2020-12-28 23:31

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.

4条回答
  •  自闭症患者
    2020-12-28 23:57

    I had the same problem with a self-signed cert, the issue was that I was generating the cert with the switch -sky signature instead of -sky exchange (you use signature for signing and exchange for encryption/decryption)

    Here is my full command to makecert that works:

    makecert -r -pe -a sha1 -n "CN=MyName" -ss my -sr CurrentUser -sky exchange
    

提交回复
热议问题