iphone - 如何: iPhone Web Service call to WCF Service with Certificate Authentication

标签 iphone wcf windows-authentication x509certificate

我们是一家 .Net 商店,目前正在开发一款 iPhone 应用程序,该应用程序需要调用 WCF Web 服务。我们的 WCF 服务通过用于身份验证目的的 x509 证书进行保护。

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

  1. 使用 iPhone 应用部署证书。
  2. 在对 WCF 服务的 Web 服务调用中使用该证书。

任何有关如何实现这一目标的见解将不胜感激。

最佳答案

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

当服务器对证书提出质询时,委托(delegate)将调用connection:didReceiveAuthenticationChallenge:方法。

请参阅有关 URL 加载系统的 Apple 指南(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)

要从 bundle 中加载 SSL 证书,请参阅此 StackOverflow answer :

关于iphone - 如何: iPhone Web Service call to WCF Service with Certificate Authentication,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2232351/

相关文章:

需要 WCF 或 Windows 服务建议

c# - 测试 WCF 服务的最佳方法是什么?

node.js - 使用 Windows 身份验证登录 Angular App

c# - 窗体身份验证之上的 ASP.NET MVC Windows 身份验证

iPhone:流式传输 WMA、MP3 和 AAC

iphone - UITableView rowHeight 空中变化

c# - 如何使用自签名证书实现 WCF 安全性?

php - 如何在 php 中打开 ssrs rdl 文件

iphone - CAGradientLayer 的问题

iOS侧边栏崩溃