如何:iPhone Web服务使用证书身份验证调用WCF服务

时间:2010-02-09 20:35:38

标签: iphone wcf windows-authentication x509certificate

我们是一家正在开发iPhone应用程序的.Net商店,需要该应用程序才能调用WCF Web服务。我们的WCF服务使用x509证书进行保护,以进行身份​​验证。

我一直在互联网上搜索如何执行以下操作的示例:

  1. 使用iPhone应用程序部署证书。
  2. 在对WCF服务的Web服务调用中使用该证书。
  3. 非常感谢任何有关如何实现这一目标的见解。

1 个答案:

答案 0 :(得分:0)

可以在异步模式下使用NSURLConnection API。您需要使用NSURLConnectionDelegate协议(http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate)实现一个对象。

当服务器质询证书时,委托将接受方法connection:didReceiveAuthenticationChallenge:的调用。

请参阅Apple指南,了解网址加载系统(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)

要从捆绑包加载SSL证书,请参阅此StackOverflow answer

相关问题