I have a PFX file that's currently installed in a DB table. The PFX file is password protected and that password is stored in the same DB in an encrypted state. Running the program on my machine and my test server works great, however, when I moved it to the VPS Service I got the error:
The specified network password is not correct.
Here's the line of code that the error is being generated:
var CertCredentials = new CertificateCredentials(new X509Certificate2(CertStore.CertificateData, decryptedPassword, X509KeyStorageFlags.MachineKeySet));
What I've tried so far is changing the keystorageflags to try each parameter but to no success. Reading up online there seemed to be some issues with making the certificate in AES Encryption which is what I originally did:
openssl pkcs12 -export -inkey key.pem -in cert.pem -out key.pfx
I have therefore also changed the key in its entirety to use SHA1 Triple DES to see if it makes any difference:
openssl pkcs12 -export -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -inkey key.pem -in cert.pem -out legacykey.pfx
Unfortunately, none of these have worked. I've got a job open with the VPS company, but I'm concerned that they're going to say it's not their problem.