• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# IUserAuthInterface
2
3
4## 概述
5
6声明用户认证驱动的API接口。
7
8**起始版本:** 3.2
9
10**相关模块:**[HdfUserAuth](_hdf_user_auth_v10.md)
11
12
13## 汇总
14
15
16### Public 成员函数
17
18| 名称 | 描述 |
19| -------- | -------- |
20| [Init](#init) () | 初始化用户认证驱动缓存信息,用于用户认证框架进程启动时初始化信息。 |
21| [AddExecutor](#addexecutor) ([in] struct [ExecutorRegisterInfo](_executor_register_info_v10.md) info, [out] unsigned long index, [out] unsigned char[] publicKey, [out] unsigned long[] templateIds) | 添加认证执行器来获取认证能力,用于各认证基础服务如口令认证服务等将认证能力对接到用户认证框架。 |
22| [DeleteExecutor](#deleteexecutor) ([in] unsigned long index) | 删除执行器,用于清理失效的执行器信息。 |
23| [OpenSession](#opensession) ([in] int userId, [out] unsigned char[] challenge) | 开启一个认证凭据管理会话,用于在请求管理用户认证凭据前获取有效挑战值。 |
24| [CloseSession](#closesession) ([in] int userId) | 关闭认证凭据管理会话,完成用户认证凭据管理请求处理后,调用该接口使原挑战值失效。 |
25| [BeginEnrollment](#beginenrollment) ([in] int userId, [in] unsigned char[] authToken, [in] struct [EnrollParam](_enroll_param_v10.md) param, [out] struct [ScheduleInfo](_schedule_info_v10.md) info) | 开始注册用户认证凭据。当注册凭据类型为口令且该用户已经注册了口令凭据时,将会更新口令凭据。 |
26| [UpdateEnrollmentResult](#updateenrollmentresult) ([in] int userId, [in] unsigned char[] scheduleResult, [out] struct [EnrollResultInfo](_enroll_result_info_v10.md) info) | 更新用户凭据注册结果,完成凭据注册。 |
27| [CancelEnrollment](#cancelenrollment) ([in] int userId) | 取消注册请求。 |
28| [DeleteCredential](#deletecredential) ([in] int userId, [in] unsigned long credentialId, [in] unsigned char[] authToken, [out] struct [CredentialInfo](_credential_info_v10.md) info) | 删除用户凭据信息。 |
29| [GetCredential](#getcredential) ([in] int userId, [in] enum [AuthType](_hdf_user_auth_v10.md#authtype) authType, [out] struct [CredentialInfo](_credential_info_v10.md)[] infos) | 查询用户凭据信息。 |
30| [GetUserInfo](#getuserinfo) ([in] int userId, [out] unsigned long secureUid, [out] enum [PinSubType](_hdf_user_auth_v10.md#pinsubtype) pinSubType, [out] struct [EnrolledInfo](_enrolled_info_v10.md)[] infos) | 查询用户认证相关信息。 |
31| [DeleteUser](#deleteuser) ([in] int userId, [in] unsigned char[] authToken, [out] struct [CredentialInfo](_credential_info_v10.md)[] deletedInfos) | 删除用户口令认证凭据,在用户IAM系统内删除该用户,该请求由用户触发。 |
32| [EnforceDeleteUser](#enforcedeleteuser) ([in] int userId, [out] struct [CredentialInfo](_credential_info_v10.md)[] deletedInfos) | 强制删除用户,该请求由系统内管理用户的模块触发。 |
33| [BeginAuthentication](#beginauthentication) ([in] unsigned long contextId, [in] struct [AuthSolution](_auth_solution_v10.md) param, [out] struct [ScheduleInfo](_schedule_info_v10.md)[] scheduleInfos) | 开始认证用户,并生成认证方案。 |
34| [UpdateAuthenticationResult](#updateauthenticationresult) ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct [AuthResultInfo](_auth_result_info_v10.md) info) | 更新认证结果,评估认证方案的认证结果。 |
35| [CancelAuthentication](#cancelauthentication) ([in] unsigned long contextId) | 取消用户认证请求。 |
36| [BeginIdentification](#beginidentification) ([in] unsigned long contextId, [in] enum [AuthType](_hdf_user_auth_v10.md#authtype) authType, [in] unsigned char[] challenge, [in] unsigned int executorSensorHint, [out] struct [ScheduleInfo](_schedule_info_v10.md) scheduleInfo) | 开始用户身份识别,并生成识别方案。 |
37| [UpdateIdentificationResult](#updateidentificationresult) ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct [IdentifyResultInfo](_identify_result_info_v10.md) info) | 更新用户身份识别结果,生成身份识别方案的结果。 |
38| [CancelIdentification](#cancelidentification) ([in] unsigned long contextId) | 取消用户身份识别请求。 |
39| [GetAuthTrustLevel](#getauthtrustlevel) ([in] int userId, [in] enum [AuthType](_hdf_user_auth_v10.md#authtype) authType, [out] unsigned int authTrustLevel) | 获取当前认证类型的认证结果可信等级。 |
40| [GetValidSolution](#getvalidsolution) ([in] int userId, [in] enum [AuthType](_hdf_user_auth_v10.md#authtype)[] authTypes, [in] unsigned int authTrustLevel, [out] enum [AuthType](_hdf_user_auth_v10.md#authtype)[] validTypes) | 获取指定认证结果可信等级下有效的认证方式。 |
41
42
43## 成员函数说明
44
45
46### AddExecutor()
47
48```
49IUserAuthInterface::AddExecutor ([in] struct ExecutorRegisterInfo info, [out] unsigned long index, [out] unsigned char[] publicKey, [out] unsigned long[] templateIds )
50```
51
52**描述**
53
54添加认证执行器来获取认证能力,用于各认证基础服务如口令认证服务等将认证能力对接到用户认证框架。
55
56**参数:**
57
58| 名称 | 描述 |
59| -------- | -------- |
60| info | 执行器注册信息[ExecutorRegisterInfo](_executor_register_info_v10.md)。 |
61| index | 用户认证框架的执行器索引。 |
62| publicKey | 用户认证框架公钥。 |
63| templateIds | 该执行器已注册的模版ID列表。 |
64
65**返回:**
66
670 表示操作成功。
68
69非0 表示操作失败。
70
71
72### BeginAuthentication()
73
74```
75IUserAuthInterface::BeginAuthentication ([in] unsigned long contextId, [in] struct AuthSolution param, [out] struct ScheduleInfo[] scheduleInfos )
76```
77
78**描述**
79
80开始认证用户,并生成认证方案。
81
82**参数:**
83
84| 名称 | 描述 |
85| -------- | -------- |
86| contextId | 上下文索引。 |
87| param | 认证方案[AuthSolution](_auth_solution_v10.md)。 |
88| scheduleInfos | 调度信息[ScheduleInfo](_schedule_info_v10.md)。 |
89
90**返回:**
91
920 表示操作成功。
93
94非0 表示操作失败。
95
96
97### BeginEnrollment()
98
99```
100IUserAuthInterface::BeginEnrollment ([in] int userId, [in] unsigned char[] authToken, [in] struct EnrollParam param, [out] struct ScheduleInfo info )
101```
102
103**描述**
104
105开始注册用户认证凭据。当注册凭据类型为口令且该用户已经注册了口令凭据时,将会更新口令凭据。
106
107**参数:**
108
109| 名称 | 描述 |
110| -------- | -------- |
111| userId | 用户ID。 |
112| authToken | 用户口令认证令牌。 |
113| param | 注册凭据参数[EnrollParam](_enroll_param_v10.md)。 |
114| info | 调度信息[ScheduleInfo](_schedule_info_v10.md)。 |
115
116**返回:**
117
1180 表示操作成功。
119
120非0 表示操作失败。
121
122
123### BeginIdentification()
124
125```
126IUserAuthInterface::BeginIdentification ([in] unsigned long contextId, [in] enum AuthType authType, [in] unsigned char[] challenge, [in] unsigned int executorSensorHint, [out] struct ScheduleInfo scheduleInfo )
127```
128
129**描述**
130
131开始用户身份识别,并生成识别方案。
132
133**参数:**
134
135| 名称 | 描述 |
136| -------- | -------- |
137| contextId | 上下文索引。 |
138| authType | 用户身份识别类型[AuthType](_hdf_user_auth_v10.md#authtype)。 |
139| challenge | 随机挑战值,用于生成用户身份识别令牌,防止重放。 |
140| executorSensorHint | 执行器传感器提示,用于找到对应认证方式的传感器。 |
141| scheduleInfo | 调度信息[ScheduleInfo](_schedule_info_v10.md)。 |
142
143**返回:**
144
1450 表示操作成功。
146
147非0 表示操作失败。
148
149
150### CancelAuthentication()
151
152```
153IUserAuthInterface::CancelAuthentication ([in] unsigned long contextId)
154```
155
156**描述**
157
158取消用户认证请求。
159
160**参数:**
161
162| 名称 | 描述 |
163| -------- | -------- |
164| contextId | 上下文索引。 |
165
166**返回:**
167
1680 表示操作成功。
169
170非0 表示操作失败。
171
172
173### CancelEnrollment()
174
175```
176IUserAuthInterface::CancelEnrollment ([in] int userId)
177```
178
179**描述**
180
181取消注册请求。
182
183**参数:**
184
185| 名称 | 描述 |
186| -------- | -------- |
187| userId | 用户ID。 |
188
189**返回:**
190
1910 表示操作成功。
192
193非0 表示操作失败。
194
195
196### CancelIdentification()
197
198```
199IUserAuthInterface::CancelIdentification ([in] unsigned long contextId)
200```
201
202**描述**
203
204取消用户身份识别请求。
205
206**参数:**
207
208| 名称 | 描述 |
209| -------- | -------- |
210| contextId | 上下文索引。 |
211
212**返回:**
213
2140 表示操作成功。
215
216非0 表示操作失败。
217
218
219### CloseSession()
220
221```
222IUserAuthInterface::CloseSession ([in] int userId)
223```
224
225**描述**
226
227关闭认证凭据管理会话,完成用户认证凭据管理请求处理后,调用该接口使原挑战值失效。
228
229**参数:**
230
231| 名称 | 描述 |
232| -------- | -------- |
233| userId | 用户ID。 |
234
235**返回:**
236
2370 表示操作成功。
238
239非0 表示操作失败。
240
241
242### DeleteCredential()
243
244```
245IUserAuthInterface::DeleteCredential ([in] int userId, [in] unsigned long credentialId, [in] unsigned char[] authToken, [out] struct CredentialInfo info )
246```
247
248**描述**
249
250删除用户凭据信息。
251
252**参数:**
253
254| 名称 | 描述 |
255| -------- | -------- |
256| userId | 用户ID。 |
257| credentialId | 凭据ID。 |
258| authToken | 用户口令认证令牌。 |
259| info | 删除的凭据信息[CredentialInfo](_credential_info_v10.md)。 |
260
261**返回:**
262
2630 表示操作成功。
264
265非0 表示操作失败。
266
267
268### DeleteExecutor()
269
270```
271IUserAuthInterface::DeleteExecutor ([in] unsigned long index)
272```
273
274**描述**
275
276删除执行器,用于清理失效的执行器信息。
277
278**参数:**
279
280| 名称 | 描述 |
281| -------- | -------- |
282| index | 用户认证框架的执行器索引。 |
283
284**返回:**
285
2860 表示操作成功。
287
288非0 表示操作失败。
289
290
291### DeleteUser()
292
293```
294IUserAuthInterface::DeleteUser ([in] int userId, [in] unsigned char[] authToken, [out] struct CredentialInfo[] deletedInfos )
295```
296
297**描述**
298
299删除用户口令认证凭据,在用户IAM系统内删除该用户,该请求由用户触发。
300
301**参数:**
302
303| 名称 | 描述 |
304| -------- | -------- |
305| userId | 用户ID。 |
306| authToken | 用户口令认证令牌。 |
307| deletedInfos | 删除的凭据信息[CredentialInfo](_credential_info_v10.md)。 |
308
309**返回:**
310
3110 表示操作成功。
312
313非0 表示操作失败。
314
315
316### EnforceDeleteUser()
317
318```
319IUserAuthInterface::EnforceDeleteUser ([in] int userId, [out] struct CredentialInfo[] deletedInfos )
320```
321
322**描述**
323
324强制删除用户,该请求由系统内管理用户的模块触发。
325
326**参数:**
327
328| 名称 | 描述 |
329| -------- | -------- |
330| userId | 用户ID。 |
331| deletedInfos | 删除的凭据信息[CredentialInfo](_credential_info_v10.md)。 |
332
333**返回:**
334
3350 表示操作成功。
336
337非0 表示操作失败。
338
339
340### GetAuthTrustLevel()
341
342```
343IUserAuthInterface::GetAuthTrustLevel ([in] int userId, [in] enum AuthType authType, [out] unsigned int authTrustLevel )
344```
345
346**描述**
347
348获取当前认证类型的认证结果可信等级。
349
350**参数:**
351
352| 名称 | 描述 |
353| -------- | -------- |
354| userId | 用户ID。 |
355| authType | 认证类型[AuthType](_hdf_user_auth_v10.md#authtype)。 |
356| authTrustLevel | 认证结果可信等级。 |
357
358**返回:**
359
3600 表示操作成功。
361
362非0 表示操作失败。
363
364
365### GetCredential()
366
367```
368IUserAuthInterface::GetCredential ([in] int userId, [in] enum AuthType authType, [out] struct CredentialInfo[] infos )
369```
370
371**描述**
372
373查询用户凭据信息。
374
375**参数:**
376
377| 名称 | 描述 |
378| -------- | -------- |
379| userId | 用户ID。 |
380| authType | 凭据类型[AuthType](_hdf_user_auth_v10.md#authtype)。 |
381| infos | 凭据信息[CredentialInfo](_credential_info_v10.md)。 |
382
383**返回:**
384
3850 表示操作成功。
386
387非0 表示操作失败。
388
389
390### GetUserInfo()
391
392```
393IUserAuthInterface::GetUserInfo ([in] int userId, [out] unsigned long secureUid, [out] enum PinSubType pinSubType, [out] struct EnrolledInfo[] infos )
394```
395
396**描述**
397
398查询用户认证相关信息。
399
400**参数:**
401
402| 名称 | 描述 |
403| -------- | -------- |
404| userId | 用户ID。 |
405| secureUid | 安全用户ID。 |
406| pinSubType | 口令认证子类型[PinSubType](_hdf_user_auth_v10.md#pinsubtype)。 |
407| infos | 注册信息[EnrolledInfo](_enrolled_info_v10.md)。 |
408
409**返回:**
410
4110 表示操作成功。
412
413非0 表示操作失败。
414
415
416### GetValidSolution()
417
418```
419IUserAuthInterface::GetValidSolution ([in] int userId, [in] enum AuthType[] authTypes, [in] unsigned int authTrustLevel, [out] enum AuthType[] validTypes )
420```
421
422**描述**
423
424获取指定认证结果可信等级下有效的认证方式。
425
426**参数:**
427
428| 名称 | 描述 |
429| -------- | -------- |
430| userId | 用户ID。 |
431| authTypes | 用于筛选的认证方式列表[AuthType](_hdf_user_auth_v10.md#authtype)。 |
432| authTrustLevel | 认证结果可信等级。 |
433| validTypes | 有效的认证方式列表[AuthType](_hdf_user_auth_v10.md#authtype)。 |
434
435**返回:**
436
4370 表示操作成功。
438
439非0 表示操作失败。
440
441
442### Init()
443
444```
445IUserAuthInterface::Init ()
446```
447
448**描述**
449
450初始化用户认证驱动缓存信息,用于用户认证框架进程启动时初始化信息。
451
452**返回:**
453
4540 表示操作成功。
455
456非0 表示操作失败。
457
458
459### OpenSession()
460
461```
462IUserAuthInterface::OpenSession ([in] int userId, [out] unsigned char[] challenge )
463```
464
465**描述**
466
467开启一个认证凭据管理会话,用于在请求管理用户认证凭据前获取有效挑战值。
468
469**参数:**
470
471| 名称 | 描述 |
472| -------- | -------- |
473| userId | 用户ID。 |
474| challenge | 随机挑战值,用于生成用户身份认证令牌。 |
475
476**返回:**
477
4780 表示操作成功。
479
480非0 表示操作失败。
481
482
483### UpdateAuthenticationResult()
484
485```
486IUserAuthInterface::UpdateAuthenticationResult ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct AuthResultInfo info )
487```
488
489**描述**
490
491更新认证结果,评估认证方案的认证结果。
492
493**参数:**
494
495| 名称 | 描述 |
496| -------- | -------- |
497| contextId | 上下文索引。 |
498| scheduleResult | 执行器签发的认证结果。 |
499| info | 认证结果信息[AuthResultInfo](_auth_result_info_v10.md)。 |
500
501**返回:**
502
5030 表示操作成功。
504
505非0 表示操作失败。
506
507
508### UpdateEnrollmentResult()
509
510```
511IUserAuthInterface::UpdateEnrollmentResult ([in] int userId, [in] unsigned char[] scheduleResult, [out] struct EnrollResultInfo info )
512```
513
514**描述**
515
516更新用户凭据注册结果,完成凭据注册。
517
518**参数:**
519
520| 名称 | 描述 |
521| -------- | -------- |
522| userId | 用户ID。 |
523| scheduleResult | 执行器签发的注册结果。 |
524| info | 录入结果信息[EnrollResultInfo](_enroll_result_info_v10.md)。 |
525
526**返回:**
527
5280 表示操作成功。
529
530非0 表示操作失败。
531
532
533### UpdateIdentificationResult()
534
535```
536IUserAuthInterface::UpdateIdentificationResult ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct IdentifyResultInfo info )
537```
538
539**描述**
540
541更新用户身份识别结果,生成身份识别方案的结果。
542
543**参数:**
544
545| 名称 | 描述 |
546| -------- | -------- |
547| contextId | 上下文索引。 |
548| scheduleResult | 执行器签发的用户身份识别结果。 |
549| info | 用户身份识别结果[IdentifyResultInfo](_identify_result_info_v10.md)。 |
550
551**返回:**
552
5530 表示操作成功。
554
555非0 表示操作失败。
556