在WindowsPhone上获取已使用的x.509证书 [英] Getting the used x.509 certificate on WindowsPhone

查看:59
本文介绍了在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(" https://www.microsoft.com"));
string aStr = aResp.RequestMessage.TransportInformation.ServerCertificate.Subject


}


Hi,

is it possible to get the used x.509 certificate for a https call on 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("https://www.microsoft.com"));
            string aStr = aResp.RequestMessage.TransportInformation.ServerCertificate.Subject


        }


这篇关于在WindowsPhone上获取已使用的x.509证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆