本文介绍了在WindowsPhone上获取已使用的x.509证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过编程方式在WindowsPhone上获取用于https呼叫的x.509证书,以检查某些内容,例如发布者名称。
解决方案
使用Windows.Web.Http HttpClient。
简单示例:
private async void Button_Click(object sender,RoutedEventArgs e) { HttpClient aClient = new HttpClient(); HttpResponseMessage aResp = await aClient.GetAsync(new Uri(" www.microsoft")); string aStr = aResp.RequestMessage.TransportInformation.ServerCertificate.Subject }
Hi,
is it possible to get the used x.509 certificate for a https callon WindowsPhone programmatically, to check some content, like the publisher name.
解决方案Use Windows.Web.Http HttpClient.
Simple example:
private async void Button_Click(object sender, RoutedEventArgs e) { HttpClient aClient = new HttpClient(); HttpResponseMessage aResp = await aClient.GetAsync(new Uri("www.microsoft")); string aStr = aResp.RequestMessage.TransportInformation.ServerCertificate.Subject }更多推荐
在WindowsPhone上获取已使用的x.509证书
发布评论