Setting Certificate Verification Information
setCAVerifyInfo
API Description
This API is used to set certificate verification information.
Precautions
1. This API is optional. By default, certificate verification is disabled.
Method Definition
1
|
- (HWMSDKERR)setCAVerifyInfo:(HWMUISDKCAVerifyInfoModel *)info; |
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
verifyMode |
Yes |
Verification mode. |
|
certPath |
No |
NSString * |
User-defined path for storing the certificate. If this parameter is left empty, the built-in certificate is used for verification. |
Enumerated Value |
Description |
---|---|
HWMUISDKVerifyModeNone |
No verification. |
HWMUISDKVerifyModeServer |
Verify the server certificate. |
Return Values
Whether the API is successfully called.
Sample Code
1 2 3 4 5 6 7 8 9 10 11 |
// Set certificate verification information. HWMUISDKCAVerifyInfoModel *model = [[HWMUISDKCAVerifyInfoModel alloc] init]; model.verifyMode = getVerifyMode(); model.certPath = getCerPath(); HWMSDKERR result = [[HWMSdk getOpenApi] setCAVerifyInfo:model]; NSString *tip = @"Set"; if (result != HWMSDKSdkerrSuccess) { // Display a message if the setting fails. tip = [NSString stringWithFormat:@"Set failed[%ld]",result]; } [HWMConsoleManager shareInstance].console = tip; |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot