X509Certificate.Export Method
- by klerik123456
I try export cert .pfx :
string certPath = "D:\\cert.pfx";
cert = new X509Certificate2(certPath, "pass");
byte[] certData = cert.Export(X509ContentType.Pfx,"pass"); /// **error in this line**
X509Certificate newCert = new X509Certificate(certData,"pass");
But it finish with this error :
Key not valid for use in specified state.
Can somebody help me ?? Any solution as export certificate from store ??