Is it possible to encrypt with private key using .net RSACryptoServiceProvider?

前端 未结 9 1980
醉话见心
醉话见心 2020-12-08 05:32

I know that RSACryptoServiceProvider can encrypt with the public key, then it can be decrypted with the private key.

Is it possible to encrypt with the private key a

9条回答
  •  暖寄归人
    2020-12-08 05:47

    You can both encrypt and decrypt with PrivateKey. PrivateKey infact contains both Private and PublicKey.

    Theoretically at least you can encrypt with PublicKey and decrypt with PrivateKey and vice-versa. In VB.net I see the first case works and secondcase throws BadKey error

提交回复
热议问题