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

前端 未结 9 1987
醉话见心
醉话见心 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 06:00

    Performing the raw RSA operation with the private key is usually called the decryption operation (just as performing it with the public key is called the encryption operation).

    It is useful to have access to this operation - for example to implement an operation that is not supported by the framework.

    The operation exists: it is the DecryptValue-method, which is defined by RSACryptoServiceProvider's base-class: System.Security.Cryptography.RSA. Unfortunately, it is not supported by RSACryptoServiceProvider (since the underlying win32-api, CryptoAPI, does not support it). If you could get hold of another .NET-implementation of the RSA-class, you would be able to do it, however.

提交回复
热议问题