iOS開發ASIHTTPRequest客戶端證書支持
作者:佚名
本文為大家介紹了iOS開發ASIHTTPRequest客戶端證書支持的內容,其中包括服務器要求提供客戶端證書時可以隨request發送證書,在iPhone/iPad示例工程中的ClientCertificateTests.m中有一個很有用的函數用來從PKCS12數據創建SecIdentityRef等等內容。
有時服務器要求提供客戶端證書,從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)。
責任編輯:閆佳明
來源:
dreamingwish