Subject: X509Certificate2  The specified network password is not correct
Date: 2022-01-13 16:41:27
From: NKosuru
Source: x509certificate2-specified-network-password-not-correct
----------------------------------------------------------------------

I am getting an error on this line.

      X509Certificate2 cert = new X509Certificate2(fileName.pfx, password, X509KeyStorageFlags.PersistKeySet);

*System.Security.Cryptography.CryptographicException: The specified network password is not correct*

The above code works in my local windows 10, but not on the Windows server 2012.. 

I have tried the following resolution that worked for others. 
Tried with different X509KeyStorageFlags properties. 
changed code to get the certificate from store instead of the file. 

Also, What is the correct way to generate the pfx file?

----------------------------------------------------------------------

Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand
If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor
who sold you the license and ask for your money back.

Back to ComponentPro Q&A Forum Index