一,iOS客戶端概述
iOS客戶端包含接口以及人臉活體認證兩大模塊。人臉活體認證負責采集用戶頭像信息,僅供參考,不建議直接使用。客戶可按示例代碼方式替換為自有活體認證庫。因此本文檔不含活體認證模塊說明。示例代碼網絡采用AFNetworking庫,如有需要客戶可自行導入。
二,接口使用說明
接口采用json格式傳輸,數據用AES128 CBC模式加密。AES密鑰請參考管理系統的機構應用信息章節,其他參數設置見示例代碼。目前接口僅有身份認證申請以及身份認證請求接口。
1, 身份認證申請對象如下:
```
@interface NLPCTIDGetBizSerialNumRequest : NLPCTIDBaseRequest
/**
認證模式,參考NLPCTIDSystemManager中NLPCTIDValidateModeType定義
*/
@property(nonatomic,strong) NSString *authMode;
@end
```
返回對象如下:
```
@interface NLPCTIDGetBizSerialNumModel : NSObject
/**
業務流水號
*/
@property (nonatomic, strong) NSString *bizSerialNum;
/**
隨機碼
*/
@property (nonatomic, strong) NSString *randNum;
@end
@interface NLPCTIDGetBizSerialNumResponse : NLPCTIDBaseResponse
@property (nonatomic, strong)NLPCTIDGetBizSerialNumModel *data;
@end
```
身份認證申請接口示例:
```
-(void)getValidateIdentityNumber:(NLPCTIDValidateIdentityRequest*)request{
NLPCTIDGetBizSerialNumRequest *bizRequest = [[NLPCTIDGetBizSerialNumRequest alloc]init];
bizRequest.authMode = request.authMode;
[NLPCTIDPlatfromIF getBizSerialNum:bizRequest completion:^(NLPCTIDGetBizSerialNumResponse *response, NSError *error) {
BOOL isSuccess;
NSString *codeMsg;
if([response isValidVResponse]){
self.vRequest.bizSerialNum = response.data.bizSerialNum;
[self startValidateIdentityRequest:self.vRequest];
isSuccess = YES;
codeMsg = @"";
return ;
}else if(response.msg){
isSuccess = NO;
codeMsg = response.msg;
}else{
isSuccess = NO;
codeMsg = error.domain;
}
[self callBackNlpCTIDFinishValidateIdentity:isSuccess errorMsg:codeMsg];
}];
}
```
2, 身份認證請求對象如下:
```
@interface NLPCTIDValidateIdentityRequest : NLPCTIDBaseRequest
/**
業務流水號(必填)
*/
@property (nonatomic, strong) NSString *bizSerialNum;
/**
認證模式(必填)
*/
@property(nonatomic,strong) NSString *authMode;
/**
待認證用戶頭像圖片(選填)
*/
@property (nonatomic, strong) NSString *photoData;
/**
待認證用戶姓名(選填)
*/
@property(nonatomic,strong) NSString *name;
/**
待認證用戶身份證號碼(選填)
*/
@property (nonatomic, strong) NSString *number;
/**
待認證用戶身份證號碼起始日期 按年月日格式如20150211 (選填)
*/
@property(nonatomic,strong) NSString *validDateStart;
/**
待認證用戶身份證號碼截止日期 按年月日格式如20150211 (選填)
*/
@property (nonatomic, strong) NSString *validDateEnd;
@end
```
返回對象如下:
```
@interface NLPCTIDValidateIdentityData :NSObject
/**
認證結果,認證通過為空
*/
@property(nonatomic,strong)NSString *authResult;
@end
@interface NLPCTIDValidateIdentityResponse : NLPCTIDBaseResponse
@property(nonatomic,strong)NLPCTIDValidateIdentityData *data;
@end
```
身份認證接口調用示例:
```
-(void)startValidateIdentityRequest:(NLPCTIDValidateIdentityRequest*)request{
[NLPCTIDPlatfromIF startCTIDValidateIdentity:request completion:^(NLPCTIDValidateIdentityResponse *response, NSError *error) {
BOOL isSuccess;
NSString *codeMsg;
if([response isValidVResponse]){
isSuccess = YES;
codeMsg = response.msg;
}else if(response.msg){
isSuccess = NO;
codeMsg = response.msg;
}else{
isSuccess = NO;
codeMsg = error.domain;
}
[self callBackNlpCTIDFinishValidateIdentity:isSuccess errorMsg:codeMsg];
}];
}
```
三,其他
示例代碼未包含APP鑒權等模塊,僅實現核心業務邏輯,客戶可根據自身業務場景需要進行擴展。
- CTID身份認證服務能力接入文檔
- 身份認證服務介紹
- 身份認證能力介紹
- 名詞解釋
- 產品定價
- 計費說明
- 接入集成介紹
- API接口列表
- 鑒權接口
- 身份認證接口
- 集成示例
- 集成示例總圖
- 客戶端加密方式接入示例
- 安卓客戶端示例
- IOS客戶端示例
- Java服務端示例
- PHP服務端示例
- 服務端加密接入方式示例
- Java服務端加密示例
- PHP服務端加密示例
- 管理系統介紹
- 登錄
- 機構應用信息
- 身份驗證日志
- 常見問題
- 客戶端加密接入方式FAQ
- Android端FAQ
- IOS端FAQ
- JAVA服務端FAQ
- PHP服務端FAQ
- 服務端加密接入方式FAQ
- JAVA服務端加密FAQ
- PHP服務端加密FAQ
- 平臺FAQ
- 服務端常見異常
- 資料下載
- 客戶端加密接入方式DEMO源碼
- 服務端加密接入方式DEMO源碼