From b07ab7d87d32d69f5b72483585895d9ff8c02cae Mon Sep 17 00:00:00 2001 From: youliang_1314 Date: Thu, 24 Nov 2022 11:22:38 +0800 Subject: [PATCH 1/2] update useriam Signed-off-by: youliang_1314 Change-Id: I2e909dd0553acd5f85d233d19eb39e8329d231a6 --- api/@ohos.userIAM.faceAuth.d.ts | 20 ++- api/@ohos.userIAM.userAuth.d.ts | 215 ++++++++++++++++---------------- 2 files changed, 117 insertions(+), 118 deletions(-) diff --git a/api/@ohos.userIAM.faceAuth.d.ts b/api/@ohos.userIAM.faceAuth.d.ts index e1ac81440a..798772c779 100644 --- a/api/@ohos.userIAM.faceAuth.d.ts +++ b/api/@ohos.userIAM.faceAuth.d.ts @@ -15,37 +15,35 @@ /** * This module provides the capability to manage face auth. - * + * @namespace faceAuth * @since 9 */ declare namespace faceAuth { /** * Provides the abilities for face authentication. - * @name FaceAuth - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth - * @systemapi Hide this for inner system use. + * @since 9 */ class FaceAuthManager { /** * Constructor to get the FaceAuthManager class instance. - * - * @since 9 - * @return Returns the FaceAuthManager class instance. + * @returns Returns the FaceAuthManager class instance. + * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth * @systemapi Hide this for inner system use. + * @since 9 */ constructor(); /** * Set XComponent surface id for camera preview during enroll. - * - * @since 9 - * @param surfaceId Indicates surface id for face enroll preview. * @permission ohos.permission.MANAGE_USER_IDM - * @systemapi Hide this for inner system use. + * @param surfaceId Indicates surface id for face enroll preview. * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 202 - The caller is not a system application. * @throws { BusinessError } 12700001 - The operation is failed. + * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth + * @systemapi Hide this for inner system use. + * @since 9 */ setSurfaceId(surfaceId: string): void; } diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index 27623d6e45..776176bc31 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -17,8 +17,9 @@ import { AsyncCallback } from './basic'; /** * User authentication - * @since 6 + * @namespace userAuth * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 */ declare namespace userAuth { export enum AuthenticationResult { @@ -104,11 +105,11 @@ declare namespace userAuth { interface Authenticator { /** * Execute authentication. - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param type Indicates the authentication type. * @param level Indicates the security level. - * @return Returns authentication result, which is specified by AuthenticationResult. + * @returns Returns authentication result, which is specified by AuthenticationResult. + * @syscap SystemCapability.UserIAM.UserAuth.Core * @deprecated since 8 */ execute(type: AuthType, level: SecureLevel, callback: AsyncCallback): void; @@ -117,23 +118,23 @@ declare namespace userAuth { /** * Get Authenticator instance. + * @returns Returns an Authenticator. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @return Returns an Authenticator. * @deprecated since 8 */ function getAuthenticator(): Authenticator; /** * User authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ class UserAuth { /** * Constructor to get the UserAuth class instance. - * @since 8 + * @returns Returns the UserAuth class instance. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @return Returns the UserAuth class instance. + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.getAuthInstance */ @@ -141,10 +142,10 @@ declare namespace userAuth { /** * Get version information. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @return Returns version information. + * @returns Returns version information. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.getVersion */ @@ -152,12 +153,12 @@ declare namespace userAuth { /** * Check whether the authentication capability is available. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param authType Credential type for authentication. * @param authTrustLevel Trust level of authentication result. - * @return Returns a check result, which is specified by getAvailableStatus. + * @returns Returns a check result, which is specified by getAvailableStatus. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.getAvailableStatus */ @@ -165,14 +166,14 @@ declare namespace userAuth { /** * Executes authentication. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @param challenge pass in challenge value. - * @param authType type of authentication. + * @param challenge Pass in challenge value. + * @param authType Type of authentication. * @param authTrustLevel Trust level of authentication result. * @param callback Return result and acquireInfo through callback. - * @return Returns ContextId for cancel. + * @returns Returns ContextId for cancel. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthInstance.start */ @@ -180,11 +181,11 @@ declare namespace userAuth { /** * Cancel authentication with ContextID. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param contextID Cancel authentication and pass in ContextID. - * @return Returns a number value indicating whether Cancel authentication was successful. + * @returns Returns a number value indicating whether Cancel authentication was successful. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthInstance.cancel */ @@ -194,13 +195,13 @@ declare namespace userAuth { interface IUserAuthCallback { /** * The authentication result code is returned through the callback. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core - * @param result authentication result code. - * @param extraInfo pass the specific information for different situation. * If the authentication is passed, the authentication token is returned in extraInfo, * If the authentication fails, the remaining authentication times are returned in extraInfo, * If the authentication executor is locked, the freezing time is returned in extraInfo. + * @param result Authentication result code. + * @param extraInfo Pass the specific information for different situation. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthEvent.callback */ @@ -208,11 +209,11 @@ declare namespace userAuth { /** * During an authentication, the TipsCode is returned through the callback. - * @since 8 + * @param module The executor type for authentication. + * @param acquire The tip code for different authentication executor. + * @param extraInfo Reserved parameter. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @param module the executor type for authentication. - * @param acquire the tip code for different authentication executor. - * @param extraInfo reserved parameter. + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthEvent.callback */ @@ -221,11 +222,11 @@ declare namespace userAuth { /** * Authentication result: authentication token, remaining authentication times, freezing time. - * @since 8 + * @param token Pass the authentication result if the authentication is passed. + * @param remainTimes Return the remaining authentication times if the authentication fails. + * @param freezingTime Return the freezing time if the authentication executor is locked. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @param token pass the authentication result if the authentication is passed. - * @param remainTimes return the remaining authentication times if the authentication fails. - * @param freezingTime return the freezing time if the authentication executor is locked. + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthResultInfo */ @@ -237,275 +238,275 @@ declare namespace userAuth { /** * Result code. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.ResultCodeV9 */ enum ResultCode { /** * Indicates that the result is success or ability is supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ SUCCESS = 0, /** * Indicates the the result is failure or ability is not supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FAIL = 1, /** * Indicates other errors. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ GENERAL_ERROR = 2, /** * Indicates that this operation has been canceled. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ CANCELED = 3, /** * Indicates that this operation has timed out. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ TIMEOUT = 4, /** * Indicates that this authentication type is not supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ TYPE_NOT_SUPPORT = 5, /** * Indicates that the authentication trust level is not supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ TRUST_LEVEL_NOT_SUPPORT = 6, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ BUSY = 7, /** * Indicates incorrect parameters. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ INVALID_PARAMETERS = 8, /** * Indicates that the authenticator is locked. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ LOCKED = 9, /** * Indicates that the user has not enrolled the authenticator. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ NOT_ENROLLED = 10 } /** * Indicates the enumeration of prompt codes in the process of face authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum FaceTips { /** * Indicates that the obtained facial image is too bright due to high illumination. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_BRIGHT = 1, /** * Indicates that the obtained facial image is too dark due to low illumination. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_DARK = 2, /** * Indicates that the face is too close to the device. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_CLOSE = 3, /** * Indicates that the face is too far away from the device. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_FAR = 4, /** * Indicates that the device is too high, and that only the upper part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_HIGH = 5, /** * Indicates that the device is too low, and that only the lower part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_LOW = 6, /** * Indicates that the device is deviated to the right, and that only the right part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_RIGHT = 7, /** * Indicates that the device is deviated to the left, and that only the left part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_LEFT = 8, /** * Indicates that the face moves too fast during facial information collection. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, /** * Indicates that the face is not facing the device. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_POOR_GAZE = 10, /** * Indicates that no face is detected. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_NOT_DETECTED = 11, } /** * Indicates the enumeration of prompt codes in the process of fingerprint authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum FingerprintTips { /** * Indicates that the image acquired is good. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_GOOD = 0, /** * Indicates that the fingerprint image is too noisy due to suspected or detected dirt on sensor. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_DIRTY = 1, /** * Indicates that the fingerprint image is too noisy to process due to a detected condition. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2, /** * Indicates that only a partial fingerprint image is detected. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_PARTIAL = 3, /** * Indicates that the fingerprint image is incomplete due to quick motion. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_TOO_FAST = 4, /** * Indicates that the fingerprint image is unreadable due to lack of motion. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_TOO_SLOW = 5 } /** * Credential type for authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum UserAuthType { /** * Authentication type face. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE = 2, /** * Authentication type fingerprint. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT = 4 } /** * Trust level of authentication results. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum AuthTrustLevel { /** * Authentication result trusted level 1. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL1 = 10000, /** * Authentication result trusted level 2. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL2 = 20000, /** * Authentication result trusted level 3. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL3 = 30000, /** * Authentication result trusted level 4. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL4 = 40000 } @@ -518,29 +519,29 @@ declare namespace userAuth { /** * Return information of Authentication events. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ type EventInfo = AuthResultInfo | TipInfo; interface AuthEvent { /** * The authentication event callback. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param result Event info. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ callback(result: EventInfo): void; } /** * Authentication result: authentication token, remaining authentication attempts, lockout duration. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param result Authentication result. * @param token Pass the authentication token if the authentication is passed. * @param remainAttempts Return the remaining authentication attempts if the authentication fails. * @param lockoutDuration Return the lockout duration if the authentication executor is locked. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ interface AuthResultInfo { result : number; @@ -551,10 +552,10 @@ declare namespace userAuth { /** * Authentication tip info. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param module Authentication module. * @param tip Tip information, used to prompt the business to perform some operations. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ interface TipInfo { module : number; @@ -563,35 +564,33 @@ declare namespace userAuth { /** * Authentication instance, used to initiate a complete authentication - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ interface AuthInstance { /** * Turn on authentication event listening. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param name Event name. * @param callback Event information return. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ on: (name: AuthEventKey, callback: AuthEvent) => void; /** * Turn off authentication event listening. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param name Event name. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ off: (name: AuthEventKey) => void; /** * Start this authentication, an instance can only perform authentication once. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 401 - Incorrect parameters. @@ -599,36 +598,36 @@ declare namespace userAuth { * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. * @throws { BusinessError } 12500010 - The type of credential has not been enrolled. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ start: () => void; /** * Cancel this authentication. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ cancel: () => void; } /** * Get version information. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @return Returns version information. + * @returns Returns version information. * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ function getVersion(): number; /** * Check whether the authentication capability is available. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param authType Credential type for authentication. * @param authTrustLevel Trust level of authentication result. @@ -638,94 +637,96 @@ declare namespace userAuth { * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. * @throws { BusinessError } 12500010 - The type of credential has not been enrolled. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ function getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel): void; /** * Get Authentication instance. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core - * @return Returns an authentication instance. + * @returns Returns an authentication instance. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ function getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel): AuthInstance; /** * Result code. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ enum ResultCodeV9 { /** * Indicates that the result is success or ability is supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ SUCCESS = 12500000, /** * Indicates the result is failure or ability is not supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ FAIL = 12500001, /** * Indicates other errors. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ GENERAL_ERROR = 12500002, /** * Indicates that this operation is canceled. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ CANCELED = 12500003, /** * Indicates that this operation is time-out. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ TIMEOUT = 12500004, /** * Indicates that this authentication type is not supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ TYPE_NOT_SUPPORT = 12500005, /** * Indicates that the authentication trust level is not supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ TRUST_LEVEL_NOT_SUPPORT = 12500006, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ BUSY = 12500007, /** * Indicates that the authenticator is locked. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ LOCKED = 12500009, /** * Indicates that the user has not enrolled the authenticator. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ NOT_ENROLLED = 12500010 } -- Gitee From f97cdf7b8f6db41fe4f9486b353352583e68333a Mon Sep 17 00:00:00 2001 From: youliang_1314 Date: Thu, 24 Nov 2022 14:24:50 +0800 Subject: [PATCH 2/2] update iam Signed-off-by: youliang_1314 Change-Id: I500039fe768d58845653702de16ecd6e6a3dd32b --- api/@ohos.userIAM.faceAuth.d.ts | 2 + api/@ohos.userIAM.userAuth.d.ts | 152 ++++++++++++++++++++++++++++---- 2 files changed, 139 insertions(+), 15 deletions(-) diff --git a/api/@ohos.userIAM.faceAuth.d.ts b/api/@ohos.userIAM.faceAuth.d.ts index 798772c779..b3026ba676 100644 --- a/api/@ohos.userIAM.faceAuth.d.ts +++ b/api/@ohos.userIAM.faceAuth.d.ts @@ -16,12 +16,14 @@ /** * This module provides the capability to manage face auth. * @namespace faceAuth + * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth * @since 9 */ declare namespace faceAuth { /** * Provides the abilities for face authentication. * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth + * @systemapi Hide this for inner system use. * @since 9 */ class FaceAuthManager { diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index 776176bc31..f1ca18438f 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -22,69 +22,99 @@ import { AsyncCallback } from './basic'; * @since 6 */ declare namespace userAuth { + /** + * Enum for authentication result. + * @enum {number} + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 + * @deprecated since 8 + * @useinstead ohos.userIAM.userAuth.ResultCode + */ export enum AuthenticationResult { /** * Indicates that the device does not support authentication. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ NO_SUPPORT = -1, /** * Indicates that authentication is success. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ SUCCESS = 0, /** * Indicates the authenticator fails to identify user. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ COMPARE_FAILURE = 1, /** * Indicates that authentication has been canceled. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ CANCELED = 2, /** * Indicates that authentication has timed out. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ TIMEOUT = 3, /** * Indicates a failure to open the camera. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ CAMERA_FAIL = 4, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ BUSY = 5, /** * Indicates incorrect parameters. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ INVALID_PARAMETERS = 6, /** * Indicates that the authenticator is locked. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ LOCKED = 7, /** * Indicates that the user has not enrolled the authenticator. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ NOT_ENROLLED = 8, /** * Indicates other errors. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ GENERAL_ERROR = 100, @@ -92,16 +122,25 @@ declare namespace userAuth { /** * Auth types + * @since 6 * @deprecated since 8 */ type AuthType = "ALL" | "FACE_ONLY"; /** * Secure levels + * @since 6 * @deprecated since 8 */ type SecureLevel = "S1" | "S2" | "S3" | "S4"; + /** + * Used to initiate authentication. + * @interface Authenticator + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 + * @deprecated since 8 + */ interface Authenticator { /** * Execute authentication. @@ -110,6 +149,7 @@ declare namespace userAuth { * @param level Indicates the security level. * @returns Returns authentication result, which is specified by AuthenticationResult. * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ execute(type: AuthType, level: SecureLevel, callback: AsyncCallback): void; @@ -128,6 +168,8 @@ declare namespace userAuth { * User authentication. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.userIAM.userAuth.AuthInstance */ class UserAuth { /** @@ -192,6 +234,14 @@ declare namespace userAuth { cancelAuth(contextID : Uint8Array) : number; } + /** + * Asynchronous callback of authentication operation. + * @interface IUserAuthCallback + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.userIAM.userAuth.AuthEvent + */ interface IUserAuthCallback { /** * The authentication result code is returned through the callback. @@ -222,22 +272,38 @@ declare namespace userAuth { /** * Authentication result: authentication token, remaining authentication times, freezing time. - * @param token Pass the authentication result if the authentication is passed. - * @param remainTimes Return the remaining authentication times if the authentication fails. - * @param freezingTime Return the freezing time if the authentication executor is locked. + * @typedef AuthResult * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthResultInfo */ interface AuthResult { + /** + * The authentication result if the authentication is passed. + * @type {Uint8Array} + * @since 8 + */ token ?: Uint8Array; + + /** + * The remaining authentication times if the authentication fails. + * @type {number} + * @since 8 + */ remainTimes ?: number; + + /** + * The freezing time if the authentication executor is locked. + * @type {number} + * @since 8 + */ freezingTime ?: number; } /** - * Result code. + * Enum for operation result. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 * @deprecated since 9 @@ -248,6 +314,7 @@ declare namespace userAuth { * Indicates that the result is success or ability is supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ SUCCESS = 0, @@ -255,6 +322,7 @@ declare namespace userAuth { * Indicates the the result is failure or ability is not supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ FAIL = 1, @@ -262,6 +330,7 @@ declare namespace userAuth { * Indicates other errors. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ GENERAL_ERROR = 2, @@ -269,6 +338,7 @@ declare namespace userAuth { * Indicates that this operation has been canceled. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ CANCELED = 3, @@ -276,6 +346,7 @@ declare namespace userAuth { * Indicates that this operation has timed out. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ TIMEOUT = 4, @@ -283,6 +354,7 @@ declare namespace userAuth { * Indicates that this authentication type is not supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ TYPE_NOT_SUPPORT = 5, @@ -290,6 +362,7 @@ declare namespace userAuth { * Indicates that the authentication trust level is not supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ TRUST_LEVEL_NOT_SUPPORT = 6, @@ -297,6 +370,7 @@ declare namespace userAuth { * Indicates that the authentication task is busy. Wait for a few seconds and try again. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ BUSY = 7, @@ -304,6 +378,7 @@ declare namespace userAuth { * Indicates incorrect parameters. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ INVALID_PARAMETERS = 8, @@ -311,6 +386,7 @@ declare namespace userAuth { * Indicates that the authenticator is locked. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ LOCKED = 9, @@ -318,12 +394,14 @@ declare namespace userAuth { * Indicates that the user has not enrolled the authenticator. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ NOT_ENROLLED = 10 } /** - * Indicates the enumeration of prompt codes in the process of face authentication. + * The enumeration of prompt codes in the process of face authentication. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -407,7 +485,8 @@ declare namespace userAuth { } /** - * Indicates the enumeration of prompt codes in the process of fingerprint authentication. + * The enumeration of prompt codes in the process of fingerprint authentication. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -457,6 +536,7 @@ declare namespace userAuth { /** * Credential type for authentication. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -478,6 +558,7 @@ declare namespace userAuth { /** * Trust level of authentication results. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -524,6 +605,12 @@ declare namespace userAuth { */ type EventInfo = AuthResultInfo | TipInfo; + /** + * Asynchronous callback of authentication event. + * @interface AuthEvent + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 + */ interface AuthEvent { /** * The authentication event callback. @@ -535,35 +622,66 @@ declare namespace userAuth { } /** - * Authentication result: authentication token, remaining authentication attempts, lockout duration. - * @param result Authentication result. - * @param token Pass the authentication token if the authentication is passed. - * @param remainAttempts Return the remaining authentication attempts if the authentication fails. - * @param lockoutDuration Return the lockout duration if the authentication executor is locked. + * Authentication result information. + * @typedef AuthResultInfo * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ interface AuthResultInfo { + /** + * The authentication result. + * @type {number} + * @since 9 + */ result : number; + + /** + * The authentication token if the authentication is passed. + * @type {Uint8Array} + * @since 9 + */ token ?: Uint8Array; + + /** + * The remaining authentication attempts if the authentication fails. + * @type {number} + * @since 9 + */ remainAttempts ?: number; + + /** + * The lockout duration if the authentication executor is locked. + * @type {number} + * @since 9 + */ lockoutDuration ?: number; } /** * Authentication tip info. - * @param module Authentication module. - * @param tip Tip information, used to prompt the business to perform some operations. + * @typedef TipInfo * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ interface TipInfo { + /** + * The authentication module of sending tip information. + * @type {number} + * @since 9 + */ module : number; + + /** + * Tip information, used to prompt the business to perform some operations. + * @type {number} + * @since 9 + */ tip : number; } /** - * Authentication instance, used to initiate a complete authentication + * Authentication instance, used to initiate a complete authentication. + * @interface AuthInstance * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ @@ -644,6 +762,9 @@ declare namespace userAuth { /** * Get Authentication instance. + * @param challenge Pass in challenge value. + * @param authType Credential type for authentication. + * @param authTrustLevel Trust level of authentication result. * @returns Returns an authentication instance. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. @@ -655,7 +776,8 @@ declare namespace userAuth { function getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel): AuthInstance; /** - * Result code. + * Enum for operation result. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ -- Gitee