Client encrypts the message using the X.509 certificate and sends the encrypted message to my web server. The client has provided a X.509 certificate without a private key (exported as DER encoded binary X.509 (.cer)). Now my task is to decrypt the message using the X.509 certificate that I have.
Whenever I try to decrypt the message I get “The private key does not exist” exception which is expected as the certificate does not contain the private key. Is it feasible to decrypt the message using the x.509 certificate without the private key?
Secondly, if client provides the password separately for the certificate can I create an instance of X509Certificate2 and use it to decrypt the message like :
X509Certificate2 c = new X509Certificate2("filename", "password");