ase*_*_le 13 authentication client certificate ios
我没有很多关于客户端证书身份验证的经验.任何人都可以告诉我如何在iOS应用程序中使用它?谢谢 :)
小智 19
您的NSURLConnection委托应该响应connection:didReceiveAuthenticationChallenge:委托方法(请参阅下面的链接).
它应该通过询问其"发件人"的挑战并为其提供适当的凭证来做出回应.
就像是:
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
id sender = [challenge sender];
// create a credential from a certificate
// see doco for details of the parameters
NSURLCredential *creds = [NSURLCredential credentialWithIdentity:ident certificates:certs persistence:persistence];
[sender useCredential:creds forAuthenticationChallenge:challenge];
}
Run Code Online (Sandbox Code Playgroud)
有关如何基于证书创建凭据的详细信息,请参阅NSURLCredential类参考:
| 归档时间: |
|
| 查看次数: |
24764 次 |
| 最近记录: |