I would like to use client certificate authentication in a Windows Store XAML application. Using makecert, I created self-signed CA and client certificates, authentication works in IIS / ASP.NET + browser (IE10, Chrome, etc.) OK. Now I wanted to use it in the Windows Store application, but I donβt know how to install the certificate. I have a cert.pfx file that I imported into IE10. Here is the code that I use to use the HTTP service over SSL.
HttpClientHandler handler = new HttpClientHandler(); handler.ClientCertificateOptions = ClientCertificateOption.Automatic; HttpClient client = new HttpClient(handler);
Not sure what the difference is between ClientCertificateOption.Automatic and ClientCertificateOption.Manual. When I try to connect, the certificate does not appear on the server, and I get error 401. I assume that the certificate is not in the application certificate store and therefore nothing is sent to the server. How do I install a certificate?
Should I use the CertificateEnrollmentManager.ImportPfxDataAsync () method? if so, how can I convert .pfx to a 'Base64 encoded PFX message' Should pfx contain a private key?
Or maybe I should use the certificate extension as described here: http://msdn.microsoft.com/en-us/library/windows/apps/hh464981.aspx#certificates_extension_content
source share