我正在开发一个与 Web 服务配合的 Xamarin 应用程序。
Xamarin 是否支持 System.ServiceModel.ClientBase 中的 X509Certificate?
下面的代码适用于使用 .Net 4.5 构建的项目:
但是Xamarin在ClientCredentials中没有看到ClientCertificate.Certificate。是否有办法将证书添加到ServiceClient中?
Xamarin 是否支持 System.ServiceModel.ClientBase 中的 X509Certificate?
下面的代码适用于使用 .Net 4.5 构建的项目:
public void Initialize()
{
var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
var endpoint = new EndpointAddress("https://ThereIsMyServerAddress/PathToService");
_mobileService = new ServiceClient(binding, endpoint);
_mobileService.ClientCredentials.ClientCertificate.Certificate = new X509Certificate2("Ivanov_Ivan_Ivanovich.cer");
}
但是Xamarin在ClientCredentials中没有看到ClientCertificate.Certificate。是否有办法将证书添加到ServiceClient中?