Certificate not works when deploy the store app package by powershell

 I request a web service with a pfx certificate in windows store app, it works well, but after I create a package by VS2013, and deploy the app with powershell, access web service failed, seems the certificate not works. Any hints, suggestion ? My code as below:

string certRawData = StringEncryptionHelper.Decrypt(ConfigurationLoader.ApplicationSettings.CertificateData.RawData);
string certPassword = StringEncryptionHelper.Decrypt(ConfigurationLoader.ApplicationSettings.CertificateData.Password);

await CertificateEnrollmentManager.ImportPfxDataAsync(certRawData,
    certPassword,
    ExportOption.Exportable,
    KeyProtectionLevel.NoConsent,
    InstallOptions.None,
    ConfigurationLoader.ApplicationSettings.CertificateData.FriendlyName);

CertificateQuery certQuery = new CertificateQuery { FriendlyName = ConfigurationLoader.ApplicationSettings.CertificateData.FriendlyName };
IReadOnlyList<Windows.Security.Cryptography.Certificates.Certificate> certs = await CertificateStores.FindAllAsync(certQuery);

certificate = certs.FirstOrDefault();
var protolFilter = new HttpBaseProtocolFilter { ClientCertificate = certificate };
var client = new HttpClient(protolFilter);
HttpResponseMessage result = await client.GetAsync(requestUri);


  • Edited by Mosser lee 23 hours 34 minutes ago update
April 9th, 2015 3:49am

Hello Mosser lee

As this issue is related to Development, it is recommended to post in the related MSDN forum.
The professionals there will be glad to help you.
https://social.msdn.microsoft.com/Forums/en-US/home

Thanks for your understanding.

Best regards,
Fangzhou CHEN

Free Windows Admin Tool Kit Click here and download it now
April 10th, 2015 2:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics