Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why I am getting Unspeicified error on trying to create a pfx certificate in c#?

My Code is as below:
X509Certificate2 certificate = new X509Certificate2(@"D:\testcert1.pfx", "password", X509KeyStorageFlags.MachineKeySet);
&
X509Store store = new X509Store(StoreName.My);
store.Open(OpenFlags.ReadWrite);
store.Add(certificate);
Posted
Updated 16-Jun-15 5:20am
v2
Comments
virusstorm 16-Jun-15 11:55am    
This is very general error that is often very confusing and misleading. Typically when I get that error, it is usually the wrong password, wrong format of the certificate, or you didn't have access to the store or it doesn't exist.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900