System.Security.Cryptography.CryptographicException: keyset does not exist

前端 未结 8 1473
时光取名叫无心
时光取名叫无心 2020-12-04 09:59

When I make x509 certificate to encypt and decypt message, I got some error information and could not fix this problem. Could someone ever happend to solve this bug? thanks.

8条回答
  •  情深已故
    2020-12-04 10:59

    I believe when using Encrypt and Decrypt it expects a public key for encrypt and a private key for decrypt. So it is failing because you are trying to decrypt without the private key and that causes the exception.

    You should really be using SignData method for creating the signature and VerifyData for the verification.

提交回复
热议问题