login about faq

I have .net third-party webbrowser that need a X509Certificate object.

I load pfx data from my db using Chilkat. I test in Windows 7 and Windows 10 and works well. In Windows XP Im Having problems. I do some test. Native code:

string file = "C:\certificates\someClientCert.pfx";
string pass = "1234"

X509Certificate2 certificate = new X509Certificate2(file, pass);
//This Show the correct client certificate name
MessageBox.Show(certificate.Subject);
//True
MessageBox.Show(certificate.HasPrivateKey().ToString());

Now with Chilkat intermediary(i test memory pfx data functions too):

string file = @"C:\certificates\someClientCert.pfx";
string pass = "1234"
var pfxFile = Path.Combine(Path.GetTempPath(), "CQ-" + Guid.NewGuid() + ".pfx");
var cert = new ChilkatCert();
cert.LoadPfxFile(file, pass);
//Same correct name certificate
MessageBox.Show(cert.SubjectCN);
//True
MessageBox.Show(cert.HasPrivateKey().ToString());
//Now exports
cert.ExportToPfxFile(pfxFile, pass, 1);
//Load exported pfx with native .net code
 X509Certificate2 certificate = new X509Certificate2(pfxFile, pass);
//This Show the correct client certificate name
MessageBox.Show(certificate.Subject);
//False. Here the error, no private key. Same code and same client certificate, in Windows 7 and Windows 10 shows True. And third party browser load well.
MessageBox.Show(certificate.HasPrivateKey().ToString());

I test reopening with Chilkat the exported cert and has private key. If I pass exported certificate to ChilkatHttp, works ok. Navigating same URL with browser control and native x509certificate, fails in XP but not in 7 or 10.

asked Jul 08 '15 at 05:51

ecreality's gravatar image

ecreality
1

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×48
×21
×10
×4

Asked: Jul 08 '15 at 05:51

Seen: 790 times

Last updated: Jul 08 '15 at 05:51

powered by OSQA