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





















