I need help resolving an issue with importing a .p12 certificate: When I use new X509Certificate2(certificado), it works in the development environment, but it throws an error when I run it on the server. The certificate is a byte[] containing the certificate.
The error on the server is: System.Security.Cryptography.CryptographicException: The specified network password is not correct.
The certificate has no password, and if I use it from the development environment, it can instantiate the class without the password.
I need to publish this process on a Windows Server 2022 with IIS .NET Framework 4.8
Any idea what could be causing this?
Thank you in advance for your help
PabloR is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.