有时服务器要求提供客户端证书,从1.8版本开始,你可以随request发送证书。
// Will send the certificate attached to the identity (identity is a SecIdentityRef)
[request setClientCertificateIdentity:identity];
// Add an additional certificate (where cert is a SecCertificateRef)
[request setClientCertificates:[NSArray arrayWithObject:(id)cert]];
在iPhone/iPad示例工程中的ClientCertificateTests.m中有一个很有用的函数用来从PKCS12数据创建SecIdentityRef (这个函数仅适用于iOS)。

本文介绍如何从1.8版本开始,在iOS应用中随请求发送客户端证书。提供了设置客户端证书身份和添加额外证书的方法,并提到了一个实用的函数,用于从PKCS12数据创建SecIdentityRef。
2064

被折叠的 条评论
为什么被折叠?



