iOS開發(fā)ASIHTTPRequest客戶端證書支持
作者:佚名
本文為大家介紹了iOS開發(fā)ASIHTTPRequest客戶端證書支持的內(nèi)容,其中包括服務(wù)器要求提供客戶端證書時(shí)可以隨request發(fā)送證書,在iPhone/iPad示例工程中的ClientCertificateTests.m中有一個(gè)很有用的函數(shù)用來從PKCS12數(shù)據(jù)創(chuàng)建SecIdentityRef等等內(nèi)容。
有時(shí)服務(wù)器要求提供客戶端證書,從1.8版本開始,你可以隨request發(fā)送證書。
- // 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中有一個(gè)很有用的函數(shù)用來從PKCS12數(shù)據(jù)創(chuàng)建SecIdentityRef (這個(gè)函數(shù)僅適用于iOS)。
責(zé)任編輯:閆佳明
來源:
dreamingwish