From 369a429a4168befe3da5e63da0c103c88e348d02 Mon Sep 17 00:00:00 2001 From: zhao_zhen_zhou Date: Wed, 31 Aug 2022 20:12:49 -0700 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao_zhen_zhou --- api/@ohos.security.huks.d.ts | 250 ++++++++++++++++++++++++++++++++--- 1 file changed, 228 insertions(+), 22 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index eb00b60114..8b44d8de8b 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -31,6 +31,17 @@ declare namespace huks { function generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function generateKey(keyAlias: string, options: HuksOptions) : Promise; + /** + * Generate Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function generateKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Delete Key. * @since 8 @@ -41,6 +52,17 @@ declare namespace huks { function deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function deleteKey(keyAlias: string, options: HuksOptions) : Promise; + /** + * Delete Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function deleteKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function deleteKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Import Key. * @since 8 @@ -52,15 +74,27 @@ declare namespace huks { function importKey(keyAlias: string, options: HuksOptions) : Promise; /** - * Import Wrapped Key. + * Import Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function importKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function importKeyItem(keyAlias: string, options: HuksOptions) : Promise; + + /** + * Import Wrapped Key. + * @param {string} keyAlias - Indicates the name of key to be imported. + * @param {string} wrappingKeyAlias - Indicates the name of key for wrapping the key to be imported + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param keyAlias Indicates the name of key to be imported. - * @param wrappingKeyAlias Indicates the name of key for wrapping the key to be imported - * @param options Indicates the properties of the key. + * @since 9 */ - function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions) : Promise; + function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions) : Promise; /** * Export Key. @@ -72,6 +106,17 @@ declare namespace huks { function exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function exportKey(keyAlias: string, options: HuksOptions) : Promise; + /** + * Export Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function exportKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Get properties of the key. * @since 8 @@ -82,6 +127,17 @@ declare namespace huks { function getKeyProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function getKeyProperties(keyAlias: string, options: HuksOptions) : Promise; + /** + * Get properties of the key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise; + /** * Check whether the key exists. * @since 8 @@ -92,6 +148,17 @@ declare namespace huks { function isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function isKeyExist(keyAlias: string, options: HuksOptions) : Promise; + /** + * Check whether the key exists. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function isKeyItemExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function isKeyItemExist(keyAlias: string, options: HuksOptions) : Promise; + /** * Init Operation. * @since 8 @@ -103,6 +170,17 @@ declare namespace huks { function init(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function init(keyAlias: string, options: HuksOptions) : Promise; + /** + * Init Operation. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function opInit(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function opInit(keyAlias: string, options: HuksOptions) : Promise; + /** * Update Operation. * @since 8 @@ -116,15 +194,28 @@ declare namespace huks { /** * Update Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the update operation. + * @param {Uint8Array} token - Indicates the value of token. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array, callback: AsyncCallback) : void; + function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + + /** + * Update Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the update operation. + * @param {Uint8Array} token - Indicates the value of token. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param handle Indicates the handle of the init operation. - * @param options Indicates the properties of the update operation. - * @param token Indicates the value of token. + * @since 9 */ - function update(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function update(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function update(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Finish Operation. @@ -138,14 +229,26 @@ declare namespace huks { /** * Finish Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the finish operation. + * @throws {BusinessError} if the type of params is wrong + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function opFinish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function opFinish(handle: number, options: HuksOptions) : Promise; + + /** + * Finish Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the finish operation. + * @param {Uint8Array} token - Indicates the value of token. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param handle Indicates the handle of the init operation. - * @param options Indicates the properties of the finish operation. - * @param token Indicates the value of token. + * @since 9 */ - function finish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function finish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function finish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function finish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Abort Operation. @@ -157,16 +260,28 @@ declare namespace huks { function abort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; function abort(handle: number, options: HuksOptions) : Promise; + /** + * Abort Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the abort operation. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function opAbort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function opAbort(handle: number, options: HuksOptions) : Promise; + /** * Key Attestation. - * @since 9 + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key attestation operation. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param keyAlias Indicates the key's name. - * @param options Indicates the properties of the key attestation operation. + * @since 9 */ - function attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function attestKey(keyAlias: string, options: HuksOptions) : Promise; + function attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function attestKey(keyAlias: string, options: HuksOptions) : Promise; /** * Get the sdk version. @@ -344,6 +459,97 @@ declare namespace huks { HUKS_ERROR_UNKNOWN_ERROR = -1000, } + /** + * @name HuksErrorCode + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export enum HuksErrorCodeItem { + HUKS_UNIVERSAL_ERROR_PERMISSION_VERIFY_FAIL = 201, + HUKS_UNIVERSAL_ERROR_PARAM_CHECK_FAIL = 401, + HUKS_UNIVERSAL_ERROR_NOT_SUPPORT_API = 801, + + HUKS_SYSTEMCAPABILITY_ERROR_NUMBER = 12000000, + + HUKS_ERROR_BASE = 1200000, + HUKS_FAILURE = 1200001 , + HUKS_ERROR_BAD_STAT= 12000002, + HUKS_ERROR_INVALID_ARGUMENT= 12000003, + HUKS_ERROR_NOT_SUPPORTED= 12000004, + HUKS_ERROR_NO_PERMISSION= 12000005, + HUKS_ERROR_INSUFFICIENT_DATA= 12000006, + HUKS_ERROR_BUFFER_TOO_SMALL= 12000007, + HUKS_ERROR_INSUFFICIENT_MEMORY= 12000008, + HUKS_ERROR_COMMUNICATION_FAILURE= 12000009, + HUKS_ERROR_STORAGE_FAILURE = 12000010, + HUKS_ERROR_HARDWARE_FAILURE= 12000011, + HUKS_ERROR_ALREADY_EXISTS= 12000012, + HUKS_ERROR_NOT_EXIST= 120000013, + HUKS_ERROR_NULL_POINTER= 12000014, + HUKS_ERROR_FILE_SIZE_FAIL= 12000015, + HUKS_ERROR_READ_FILE_FAIL= 12000016, + HUKS_ERROR_INVALID_PUBLIC_KEY= 12000017, + HUKS_ERROR_INVALID_PRIVATE_KEY= 12000018, + HUKS_ERROR_INVALID_KEY_INFO= 12000019, + HUKS_ERROR_HASH_NOT_EQUAL = 12000020, + HUKS_ERROR_MALLOC_FAIL= 12000021, + HUKS_ERROR_WRITE_FILE_FAIL= 12000022, + HUKS_ERROR_REMOVE_FILE_FAIL= 12000023, + HUKS_ERROR_OPEN_FILE_FAIL= 12000024, + HUKS_ERROR_CLOSE_FILE_FAI= 12000025, + HUKS_ERROR_MAKE_DIR_FAIL= 12000026, + HUKS_ERROR_INVALID_KEY_FILE= 12000027, + HUKS_ERROR_IPC_MSG_FAIL= 12000028, + HUKS_ERROR_REQUEST_OVERFLOWS= 12000029 + HUKS_ERROR_PARAM_NOT_EXIST = 12000030, + HUKS_ERROR_CRYPTO_ENGINE_ERROR= 12000031 + HUKS_ERROR_COMMUNICATION_TIMEOUT= 12000032, + HUKS_ERROR_IPC_INIT_FAIL= 12000033, + HUKS_ERROR_IPC_DLOPEN_FAIL= 12000034, + HUKS_ERROR_EFUSE_READ_FAIL= 12000035, + HUKS_ERROR_NEW_ROOT_KEY_MATERIAL_EXIST= 12000036, + HUKS_ERROR_UPDATE_ROOT_KEY_MATERIAL_FAIL= 12000037, + HUKS_ERROR_VERIFICATION_FAILED= 12000038, + HUKS_ERROR_SESSION_REACHED_LIMIT= 12000039, + HUKS_ERROR_GET_USERIAM_SECINFO_FAILED = 12000040, + HUKS_ERROR_GET_USERIAM_AUTHINFO_FAILED = 12000041, + HUKS_ERROR_USER_AUTH_TYPE_NOT_SUPPORT = 12000042, + HUKS_ERROR_KEY_AUTH_FAILED = 12000043, + HUKS_ERROR_DEVICE_NO_CREDENTIAL = 12000044, + + HUKS_ERROR_CHECK_GET_ALG_FAIL = 12000100, + HUKS_ERROR_CHECK_GET_KEY_SIZE_FAIL = 12000101, + HUKS_ERROR_CHECK_GET_PADDING_FAIL = 12000102, + HUKS_ERROR_CHECK_GET_PURPOSE_FAIL = 12000103, + HUKS_ERROR_CHECK_GET_DIGEST_FAIL = 12000104, + HUKS_ERROR_CHECK_GET_MODE_FAIL = 12000105, + HUKS_ERROR_CHECK_GET_NONCE_FAIL = 12000106, + HUKS_ERROR_CHECK_GET_AAD_FAIL = 12000107, + HUKS_ERROR_CHECK_GET_IV_FAIL = 12000108, + HUKS_ERROR_CHECK_GET_AE_TAG_FAIL = 12000109, + HUKS_ERROR_CHECK_GET_SALT_FAIL = 12000110, + HUKS_ERROR_CHECK_GET_ITERATION_FAIL = 12000111, + HUKS_ERROR_INVALID_ALGORITHM = 12000112, + HUKS_ERROR_INVALID_KEY_SIZE = 12000113, + HUKS_ERROR_INVALID_PADDING = 12000114, + HUKS_ERROR_INVALID_PURPOSE = 12000115, + HUKS_ERROR_INVALID_MODE = 12000116, + HUKS_ERROR_INVALID_DIGEST = 12000117, + HUKS_ERROR_INVALID_SIGNATURE_SIZE = 12000118, + HUKS_ERROR_INVALID_IV = 12000119, + HUKS_ERROR_INVALID_AAD = 12000120, + HUKS_ERROR_INVALID_NONCE = 12000121, + HUKS_ERROR_INVALID_AE_TAG = 12000122, + HUKS_ERROR_INVALID_SALT = 12000123, + HUKS_ERROR_INVALID_ITERATION = 12000124, + HUKS_ERROR_INVALID_OPERATION = 12000125, + HUKS_ERROR_INVALID_WRAPPED_FORMAT = 12000126, + HUKS_ERROR_INVALID_USAGE_OF_KEY = 12000127, + + HUKS_ERROR_INTERNAL_ERROR = 12000999, + HUKS_ERROR_UNKNOWN_ERROR = 12001000, + } + /** * @name HuksKeyPurpose * @since 8 -- Gitee From faa6e4cfe58980465eca4dcc75b01cb769143f5f Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 15:35:47 +0800 Subject: [PATCH 2/9] normalize exception handle and error code --- api/@ohos.security.huks.d.ts | 194 +++++++++++++---------------------- api/@system.cipher.d.ts | 2 + 2 files changed, 72 insertions(+), 124 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 8b44d8de8b..340447d301 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -23,6 +23,7 @@ import {AsyncCallback} from './basic'; declare namespace huks { /** * Generate Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -32,7 +33,7 @@ declare namespace huks { function generateKey(keyAlias: string, options: HuksOptions) : Promise; /** - * Generate Key. + * Generate Key. * @param {string} keyAlias - Indicates the key's name. * @param {HuksOptions} options - Indicates the properties of the key. * @throws {BusinessError} if the type of params is wrong. @@ -44,6 +45,7 @@ declare namespace huks { /** * Delete Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -65,6 +67,7 @@ declare namespace huks { /** * Import Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -98,6 +101,7 @@ declare namespace huks { /** * Export Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -114,11 +118,12 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function exportKeyItem(keyAlias: string, options: HuksOptions) : Promise; + function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function exportKeyItem(keyAlias: string, options: HuksOptions) : Promise; /** * Get properties of the key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -135,11 +140,12 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise; + function getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise; /** * Check whether the key exists. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -161,6 +167,7 @@ declare namespace huks { /** * Init Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -178,11 +185,12 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function opInit(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function opInit(keyAlias: string, options: HuksOptions) : Promise; + function doInit(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function doInit(keyAlias: string, options: HuksOptions) : Promise; /** * Update Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -201,24 +209,13 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array, callback: AsyncCallback) : void; - function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; - - /** - * Update Operation. - * @param {number} handle - Indicates the handle of the init operation. - * @param {HuksOptions} options - Indicates the properties of the update operation. - * @param {Uint8Array} token - Indicates the value of token. - * @throws {BusinessError} if the type of params is wrong. - * @syscap SystemCapability.Security.Huks - * @since 9 - */ - function update(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function doUpdate(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function doUpdate(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function doUpdate(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Finish Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -227,17 +224,6 @@ declare namespace huks { function finish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; function finish(handle: number, options: HuksOptions) : Promise; - /** - * Finish Operation. - * @param {number} handle - Indicates the handle of the init operation. - * @param {HuksOptions} options - Indicates the properties of the finish operation. - * @throws {BusinessError} if the type of params is wrong - * @syscap SystemCapability.Security.Huks - * @since 9 - */ - function opFinish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function opFinish(handle: number, options: HuksOptions) : Promise; - /** * Finish Operation. * @param {number} handle - Indicates the handle of the init operation. @@ -247,11 +233,13 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function finish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function finish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function doFinish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function doFinish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function doFinish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Abort Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -268,8 +256,8 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function opAbort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function opAbort(handle: number, options: HuksOptions) : Promise; + function doAbort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function doAbort(handle: number, options: HuksOptions) : Promise; /** @@ -280,8 +268,8 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function attestKey(keyAlias: string, options: HuksOptions) : Promise; + function attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function attestKeyItem(keyAlias: string, options: HuksOptions) : Promise; /** * Get the sdk version. @@ -304,6 +292,7 @@ declare namespace huks { /** * Interface of huks handle. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -313,6 +302,16 @@ declare namespace huks { token?: Uint8Array; } + /** + * Interface of huks handle. + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export interface HuksSessionHandle { + handle: number; + token?: Uint8Array; + } + /** * Interface of huks option. * @since 8 @@ -325,6 +324,7 @@ declare namespace huks { /** * Interface of huks result. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -335,8 +335,20 @@ declare namespace huks { certChains?: Array; } + /** + * Interface of huks result. + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export interface HuksReturnResult { + outData?: Uint8Array; + properties?: Array; + certChains?: Array; + } + /** * @name HuksErrorCode + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -460,94 +472,28 @@ declare namespace huks { } /** - * @name HuksErrorCode + * @name HuksExceptionErrCode * @since 9 * @syscap SystemCapability.Security.Huks */ - export enum HuksErrorCodeItem { - HUKS_UNIVERSAL_ERROR_PERMISSION_VERIFY_FAIL = 201, - HUKS_UNIVERSAL_ERROR_PARAM_CHECK_FAIL = 401, - HUKS_UNIVERSAL_ERROR_NOT_SUPPORT_API = 801, - - HUKS_SYSTEMCAPABILITY_ERROR_NUMBER = 12000000, - - HUKS_ERROR_BASE = 1200000, - HUKS_FAILURE = 1200001 , - HUKS_ERROR_BAD_STAT= 12000002, - HUKS_ERROR_INVALID_ARGUMENT= 12000003, - HUKS_ERROR_NOT_SUPPORTED= 12000004, - HUKS_ERROR_NO_PERMISSION= 12000005, - HUKS_ERROR_INSUFFICIENT_DATA= 12000006, - HUKS_ERROR_BUFFER_TOO_SMALL= 12000007, - HUKS_ERROR_INSUFFICIENT_MEMORY= 12000008, - HUKS_ERROR_COMMUNICATION_FAILURE= 12000009, - HUKS_ERROR_STORAGE_FAILURE = 12000010, - HUKS_ERROR_HARDWARE_FAILURE= 12000011, - HUKS_ERROR_ALREADY_EXISTS= 12000012, - HUKS_ERROR_NOT_EXIST= 120000013, - HUKS_ERROR_NULL_POINTER= 12000014, - HUKS_ERROR_FILE_SIZE_FAIL= 12000015, - HUKS_ERROR_READ_FILE_FAIL= 12000016, - HUKS_ERROR_INVALID_PUBLIC_KEY= 12000017, - HUKS_ERROR_INVALID_PRIVATE_KEY= 12000018, - HUKS_ERROR_INVALID_KEY_INFO= 12000019, - HUKS_ERROR_HASH_NOT_EQUAL = 12000020, - HUKS_ERROR_MALLOC_FAIL= 12000021, - HUKS_ERROR_WRITE_FILE_FAIL= 12000022, - HUKS_ERROR_REMOVE_FILE_FAIL= 12000023, - HUKS_ERROR_OPEN_FILE_FAIL= 12000024, - HUKS_ERROR_CLOSE_FILE_FAI= 12000025, - HUKS_ERROR_MAKE_DIR_FAIL= 12000026, - HUKS_ERROR_INVALID_KEY_FILE= 12000027, - HUKS_ERROR_IPC_MSG_FAIL= 12000028, - HUKS_ERROR_REQUEST_OVERFLOWS= 12000029 - HUKS_ERROR_PARAM_NOT_EXIST = 12000030, - HUKS_ERROR_CRYPTO_ENGINE_ERROR= 12000031 - HUKS_ERROR_COMMUNICATION_TIMEOUT= 12000032, - HUKS_ERROR_IPC_INIT_FAIL= 12000033, - HUKS_ERROR_IPC_DLOPEN_FAIL= 12000034, - HUKS_ERROR_EFUSE_READ_FAIL= 12000035, - HUKS_ERROR_NEW_ROOT_KEY_MATERIAL_EXIST= 12000036, - HUKS_ERROR_UPDATE_ROOT_KEY_MATERIAL_FAIL= 12000037, - HUKS_ERROR_VERIFICATION_FAILED= 12000038, - HUKS_ERROR_SESSION_REACHED_LIMIT= 12000039, - HUKS_ERROR_GET_USERIAM_SECINFO_FAILED = 12000040, - HUKS_ERROR_GET_USERIAM_AUTHINFO_FAILED = 12000041, - HUKS_ERROR_USER_AUTH_TYPE_NOT_SUPPORT = 12000042, - HUKS_ERROR_KEY_AUTH_FAILED = 12000043, - HUKS_ERROR_DEVICE_NO_CREDENTIAL = 12000044, - - HUKS_ERROR_CHECK_GET_ALG_FAIL = 12000100, - HUKS_ERROR_CHECK_GET_KEY_SIZE_FAIL = 12000101, - HUKS_ERROR_CHECK_GET_PADDING_FAIL = 12000102, - HUKS_ERROR_CHECK_GET_PURPOSE_FAIL = 12000103, - HUKS_ERROR_CHECK_GET_DIGEST_FAIL = 12000104, - HUKS_ERROR_CHECK_GET_MODE_FAIL = 12000105, - HUKS_ERROR_CHECK_GET_NONCE_FAIL = 12000106, - HUKS_ERROR_CHECK_GET_AAD_FAIL = 12000107, - HUKS_ERROR_CHECK_GET_IV_FAIL = 12000108, - HUKS_ERROR_CHECK_GET_AE_TAG_FAIL = 12000109, - HUKS_ERROR_CHECK_GET_SALT_FAIL = 12000110, - HUKS_ERROR_CHECK_GET_ITERATION_FAIL = 12000111, - HUKS_ERROR_INVALID_ALGORITHM = 12000112, - HUKS_ERROR_INVALID_KEY_SIZE = 12000113, - HUKS_ERROR_INVALID_PADDING = 12000114, - HUKS_ERROR_INVALID_PURPOSE = 12000115, - HUKS_ERROR_INVALID_MODE = 12000116, - HUKS_ERROR_INVALID_DIGEST = 12000117, - HUKS_ERROR_INVALID_SIGNATURE_SIZE = 12000118, - HUKS_ERROR_INVALID_IV = 12000119, - HUKS_ERROR_INVALID_AAD = 12000120, - HUKS_ERROR_INVALID_NONCE = 12000121, - HUKS_ERROR_INVALID_AE_TAG = 12000122, - HUKS_ERROR_INVALID_SALT = 12000123, - HUKS_ERROR_INVALID_ITERATION = 12000124, - HUKS_ERROR_INVALID_OPERATION = 12000125, - HUKS_ERROR_INVALID_WRAPPED_FORMAT = 12000126, - HUKS_ERROR_INVALID_USAGE_OF_KEY = 12000127, - - HUKS_ERROR_INTERNAL_ERROR = 12000999, - HUKS_ERROR_UNKNOWN_ERROR = 12001000, + export enum HuksExceptionErrCode { + HUKS_ERR_CODE_PERMISSION_FAIL = 201, + HUKS_ERR_CODE_ILLEGAL_ARGUMENT = 401, + HUKS_ERR_CODE_NOT_SUPPORTED_API = 801, + + HUKS_ERR_CODE_FEATURE_NOT_SUPPORTED = 12000001, + HUKS_ERR_CODE_MISSING_CRYPTO_ALG_ARGUMENT = 12000002, + HUKS_ERR_CODE_INVALID_CRYPTO_ALG_ARGUMENT = 12000003, + HUKS_ERR_CODE_FILE_OPERATION_FAIL = 12000004, + HUKS_ERR_CODE_COMMUNICATION_FAIL = 12000005, + HUKS_ERR_CODE_CRYPTO_FAIL = 12000006, + HUKS_ERR_CODE_KEY_AUTH_PERMANENTLY_INVALIDATED = 12000007, + HUKS_ERR_CODE_KEY_AUTH_VERIFY_FAILED = 12000008, + HUKS_ERR_CODE_KEY_AUTH_TIME_OUT = 12000009, + HUKS_ERR_CODE_SESSION_LIMIT = 12000010, + HUKS_ERR_CODE_ITEM_NOT_EXIST = 12000011, + HUKS_ERR_CODE_INTERNAL_ERROR = 12000012, + HUKS_ERR_CODE_CREDENTIAL_NOT_EXIST = 12000013, } /** diff --git a/api/@system.cipher.d.ts b/api/@system.cipher.d.ts index 11f0cfb9f5..71e1f6a6ff 100644 --- a/api/@system.cipher.d.ts +++ b/api/@system.cipher.d.ts @@ -194,6 +194,7 @@ export interface CipherAesOptions { export default class Cipher { /** * Encrypts or decrypts data using RSA. + * @Deprecated * @param options RSA options * @syscap SystemCapability.Security.Cipher */ @@ -201,6 +202,7 @@ export default class Cipher { /** * Encrypts or decrypts data using AES. + * @Deprecated * @param options AES options * @syscap SystemCapability.Security.Cipher */ -- Gitee From e9ef42186487bc4f76a48bede620ee13a76f5d26 Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 15:53:45 +0800 Subject: [PATCH 3/9] modify annotation --- api/@ohos.security.huks.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 340447d301..b531badde8 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -204,7 +204,7 @@ declare namespace huks { * Update Operation. * @param {number} handle - Indicates the handle of the init operation. * @param {HuksOptions} options - Indicates the properties of the update operation. - * @param {Uint8Array} token - Indicates the value of token. + * @param {Uint8Array} token - Indicates the value of AuthToken from USER IAM service. * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks * @since 9 @@ -228,7 +228,7 @@ declare namespace huks { * Finish Operation. * @param {number} handle - Indicates the handle of the init operation. * @param {HuksOptions} options - Indicates the properties of the finish operation. - * @param {Uint8Array} token - Indicates the value of token. + * @param {Uint8Array} token - Indicates the value of AuthToken from USER IAM service. * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks * @since 9 @@ -309,7 +309,7 @@ declare namespace huks { */ export interface HuksSessionHandle { handle: number; - token?: Uint8Array; + challenge?: Uint8Array; } /** -- Gitee From 0af9aec67ad442609247ddae50e883ed0b2356d9 Mon Sep 17 00:00:00 2001 From: zhao_zhen_zhou Date: Wed, 31 Aug 2022 20:12:49 -0700 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao_zhen_zhou --- api/@ohos.security.huks.d.ts | 250 ++++++++++++++++++++++++++++++++--- 1 file changed, 228 insertions(+), 22 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index eb00b60114..8b44d8de8b 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -31,6 +31,17 @@ declare namespace huks { function generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function generateKey(keyAlias: string, options: HuksOptions) : Promise; + /** + * Generate Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function generateKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Delete Key. * @since 8 @@ -41,6 +52,17 @@ declare namespace huks { function deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function deleteKey(keyAlias: string, options: HuksOptions) : Promise; + /** + * Delete Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function deleteKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function deleteKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Import Key. * @since 8 @@ -52,15 +74,27 @@ declare namespace huks { function importKey(keyAlias: string, options: HuksOptions) : Promise; /** - * Import Wrapped Key. + * Import Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function importKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function importKeyItem(keyAlias: string, options: HuksOptions) : Promise; + + /** + * Import Wrapped Key. + * @param {string} keyAlias - Indicates the name of key to be imported. + * @param {string} wrappingKeyAlias - Indicates the name of key for wrapping the key to be imported + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param keyAlias Indicates the name of key to be imported. - * @param wrappingKeyAlias Indicates the name of key for wrapping the key to be imported - * @param options Indicates the properties of the key. + * @since 9 */ - function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions) : Promise; + function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions) : Promise; /** * Export Key. @@ -72,6 +106,17 @@ declare namespace huks { function exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function exportKey(keyAlias: string, options: HuksOptions) : Promise; + /** + * Export Key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function exportKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Get properties of the key. * @since 8 @@ -82,6 +127,17 @@ declare namespace huks { function getKeyProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function getKeyProperties(keyAlias: string, options: HuksOptions) : Promise; + /** + * Get properties of the key. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise; + /** * Check whether the key exists. * @since 8 @@ -92,6 +148,17 @@ declare namespace huks { function isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function isKeyExist(keyAlias: string, options: HuksOptions) : Promise; + /** + * Check whether the key exists. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function isKeyItemExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function isKeyItemExist(keyAlias: string, options: HuksOptions) : Promise; + /** * Init Operation. * @since 8 @@ -103,6 +170,17 @@ declare namespace huks { function init(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; function init(keyAlias: string, options: HuksOptions) : Promise; + /** + * Init Operation. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function opInit(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function opInit(keyAlias: string, options: HuksOptions) : Promise; + /** * Update Operation. * @since 8 @@ -116,15 +194,28 @@ declare namespace huks { /** * Update Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the update operation. + * @param {Uint8Array} token - Indicates the value of token. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array, callback: AsyncCallback) : void; + function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + + /** + * Update Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the update operation. + * @param {Uint8Array} token - Indicates the value of token. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param handle Indicates the handle of the init operation. - * @param options Indicates the properties of the update operation. - * @param token Indicates the value of token. + * @since 9 */ - function update(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function update(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function update(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Finish Operation. @@ -138,14 +229,26 @@ declare namespace huks { /** * Finish Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the finish operation. + * @throws {BusinessError} if the type of params is wrong + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function opFinish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function opFinish(handle: number, options: HuksOptions) : Promise; + + /** + * Finish Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the finish operation. + * @param {Uint8Array} token - Indicates the value of token. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param handle Indicates the handle of the init operation. - * @param options Indicates the properties of the finish operation. - * @param token Indicates the value of token. + * @since 9 */ - function finish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function finish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function finish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function finish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Abort Operation. @@ -157,16 +260,28 @@ declare namespace huks { function abort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; function abort(handle: number, options: HuksOptions) : Promise; + /** + * Abort Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the abort operation. + * @throws {BusinessError} if the type of params is wrong. + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function opAbort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function opAbort(handle: number, options: HuksOptions) : Promise; + /** * Key Attestation. - * @since 9 + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key attestation operation. + * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks - * @param keyAlias Indicates the key's name. - * @param options Indicates the properties of the key attestation operation. + * @since 9 */ - function attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function attestKey(keyAlias: string, options: HuksOptions) : Promise; + function attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function attestKey(keyAlias: string, options: HuksOptions) : Promise; /** * Get the sdk version. @@ -344,6 +459,97 @@ declare namespace huks { HUKS_ERROR_UNKNOWN_ERROR = -1000, } + /** + * @name HuksErrorCode + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export enum HuksErrorCodeItem { + HUKS_UNIVERSAL_ERROR_PERMISSION_VERIFY_FAIL = 201, + HUKS_UNIVERSAL_ERROR_PARAM_CHECK_FAIL = 401, + HUKS_UNIVERSAL_ERROR_NOT_SUPPORT_API = 801, + + HUKS_SYSTEMCAPABILITY_ERROR_NUMBER = 12000000, + + HUKS_ERROR_BASE = 1200000, + HUKS_FAILURE = 1200001 , + HUKS_ERROR_BAD_STAT= 12000002, + HUKS_ERROR_INVALID_ARGUMENT= 12000003, + HUKS_ERROR_NOT_SUPPORTED= 12000004, + HUKS_ERROR_NO_PERMISSION= 12000005, + HUKS_ERROR_INSUFFICIENT_DATA= 12000006, + HUKS_ERROR_BUFFER_TOO_SMALL= 12000007, + HUKS_ERROR_INSUFFICIENT_MEMORY= 12000008, + HUKS_ERROR_COMMUNICATION_FAILURE= 12000009, + HUKS_ERROR_STORAGE_FAILURE = 12000010, + HUKS_ERROR_HARDWARE_FAILURE= 12000011, + HUKS_ERROR_ALREADY_EXISTS= 12000012, + HUKS_ERROR_NOT_EXIST= 120000013, + HUKS_ERROR_NULL_POINTER= 12000014, + HUKS_ERROR_FILE_SIZE_FAIL= 12000015, + HUKS_ERROR_READ_FILE_FAIL= 12000016, + HUKS_ERROR_INVALID_PUBLIC_KEY= 12000017, + HUKS_ERROR_INVALID_PRIVATE_KEY= 12000018, + HUKS_ERROR_INVALID_KEY_INFO= 12000019, + HUKS_ERROR_HASH_NOT_EQUAL = 12000020, + HUKS_ERROR_MALLOC_FAIL= 12000021, + HUKS_ERROR_WRITE_FILE_FAIL= 12000022, + HUKS_ERROR_REMOVE_FILE_FAIL= 12000023, + HUKS_ERROR_OPEN_FILE_FAIL= 12000024, + HUKS_ERROR_CLOSE_FILE_FAI= 12000025, + HUKS_ERROR_MAKE_DIR_FAIL= 12000026, + HUKS_ERROR_INVALID_KEY_FILE= 12000027, + HUKS_ERROR_IPC_MSG_FAIL= 12000028, + HUKS_ERROR_REQUEST_OVERFLOWS= 12000029 + HUKS_ERROR_PARAM_NOT_EXIST = 12000030, + HUKS_ERROR_CRYPTO_ENGINE_ERROR= 12000031 + HUKS_ERROR_COMMUNICATION_TIMEOUT= 12000032, + HUKS_ERROR_IPC_INIT_FAIL= 12000033, + HUKS_ERROR_IPC_DLOPEN_FAIL= 12000034, + HUKS_ERROR_EFUSE_READ_FAIL= 12000035, + HUKS_ERROR_NEW_ROOT_KEY_MATERIAL_EXIST= 12000036, + HUKS_ERROR_UPDATE_ROOT_KEY_MATERIAL_FAIL= 12000037, + HUKS_ERROR_VERIFICATION_FAILED= 12000038, + HUKS_ERROR_SESSION_REACHED_LIMIT= 12000039, + HUKS_ERROR_GET_USERIAM_SECINFO_FAILED = 12000040, + HUKS_ERROR_GET_USERIAM_AUTHINFO_FAILED = 12000041, + HUKS_ERROR_USER_AUTH_TYPE_NOT_SUPPORT = 12000042, + HUKS_ERROR_KEY_AUTH_FAILED = 12000043, + HUKS_ERROR_DEVICE_NO_CREDENTIAL = 12000044, + + HUKS_ERROR_CHECK_GET_ALG_FAIL = 12000100, + HUKS_ERROR_CHECK_GET_KEY_SIZE_FAIL = 12000101, + HUKS_ERROR_CHECK_GET_PADDING_FAIL = 12000102, + HUKS_ERROR_CHECK_GET_PURPOSE_FAIL = 12000103, + HUKS_ERROR_CHECK_GET_DIGEST_FAIL = 12000104, + HUKS_ERROR_CHECK_GET_MODE_FAIL = 12000105, + HUKS_ERROR_CHECK_GET_NONCE_FAIL = 12000106, + HUKS_ERROR_CHECK_GET_AAD_FAIL = 12000107, + HUKS_ERROR_CHECK_GET_IV_FAIL = 12000108, + HUKS_ERROR_CHECK_GET_AE_TAG_FAIL = 12000109, + HUKS_ERROR_CHECK_GET_SALT_FAIL = 12000110, + HUKS_ERROR_CHECK_GET_ITERATION_FAIL = 12000111, + HUKS_ERROR_INVALID_ALGORITHM = 12000112, + HUKS_ERROR_INVALID_KEY_SIZE = 12000113, + HUKS_ERROR_INVALID_PADDING = 12000114, + HUKS_ERROR_INVALID_PURPOSE = 12000115, + HUKS_ERROR_INVALID_MODE = 12000116, + HUKS_ERROR_INVALID_DIGEST = 12000117, + HUKS_ERROR_INVALID_SIGNATURE_SIZE = 12000118, + HUKS_ERROR_INVALID_IV = 12000119, + HUKS_ERROR_INVALID_AAD = 12000120, + HUKS_ERROR_INVALID_NONCE = 12000121, + HUKS_ERROR_INVALID_AE_TAG = 12000122, + HUKS_ERROR_INVALID_SALT = 12000123, + HUKS_ERROR_INVALID_ITERATION = 12000124, + HUKS_ERROR_INVALID_OPERATION = 12000125, + HUKS_ERROR_INVALID_WRAPPED_FORMAT = 12000126, + HUKS_ERROR_INVALID_USAGE_OF_KEY = 12000127, + + HUKS_ERROR_INTERNAL_ERROR = 12000999, + HUKS_ERROR_UNKNOWN_ERROR = 12001000, + } + /** * @name HuksKeyPurpose * @since 8 -- Gitee From 4594e70d2cb84c4ebf4a0dd2759a1166b1b8f0da Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 15:35:47 +0800 Subject: [PATCH 5/9] normalize exception handle and error code --- api/@ohos.security.huks.d.ts | 194 +++++++++++++---------------------- api/@system.cipher.d.ts | 2 + 2 files changed, 72 insertions(+), 124 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 8b44d8de8b..340447d301 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -23,6 +23,7 @@ import {AsyncCallback} from './basic'; declare namespace huks { /** * Generate Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -32,7 +33,7 @@ declare namespace huks { function generateKey(keyAlias: string, options: HuksOptions) : Promise; /** - * Generate Key. + * Generate Key. * @param {string} keyAlias - Indicates the key's name. * @param {HuksOptions} options - Indicates the properties of the key. * @throws {BusinessError} if the type of params is wrong. @@ -44,6 +45,7 @@ declare namespace huks { /** * Delete Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -65,6 +67,7 @@ declare namespace huks { /** * Import Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -98,6 +101,7 @@ declare namespace huks { /** * Export Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -114,11 +118,12 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function exportKeyItem(keyAlias: string, options: HuksOptions) : Promise; + function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function exportKeyItem(keyAlias: string, options: HuksOptions) : Promise; /** * Get properties of the key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -135,11 +140,12 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise; + function getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise; /** * Check whether the key exists. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -161,6 +167,7 @@ declare namespace huks { /** * Init Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -178,11 +185,12 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function opInit(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function opInit(keyAlias: string, options: HuksOptions) : Promise; + function doInit(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function doInit(keyAlias: string, options: HuksOptions) : Promise; /** * Update Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -201,24 +209,13 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array, callback: AsyncCallback) : void; - function opUpdate(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; - - /** - * Update Operation. - * @param {number} handle - Indicates the handle of the init operation. - * @param {HuksOptions} options - Indicates the properties of the update operation. - * @param {Uint8Array} token - Indicates the value of token. - * @throws {BusinessError} if the type of params is wrong. - * @syscap SystemCapability.Security.Huks - * @since 9 - */ - function update(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function update(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function doUpdate(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function doUpdate(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function doUpdate(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Finish Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -227,17 +224,6 @@ declare namespace huks { function finish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; function finish(handle: number, options: HuksOptions) : Promise; - /** - * Finish Operation. - * @param {number} handle - Indicates the handle of the init operation. - * @param {HuksOptions} options - Indicates the properties of the finish operation. - * @throws {BusinessError} if the type of params is wrong - * @syscap SystemCapability.Security.Huks - * @since 9 - */ - function opFinish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function opFinish(handle: number, options: HuksOptions) : Promise; - /** * Finish Operation. * @param {number} handle - Indicates the handle of the init operation. @@ -247,11 +233,13 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function finish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; - function finish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; + function doFinish(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function doFinish(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function doFinish(handle: number, options: HuksOptions, token?: Uint8Array) : Promise; /** * Abort Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -268,8 +256,8 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function opAbort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; - function opAbort(handle: number, options: HuksOptions) : Promise; + function doAbort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function doAbort(handle: number, options: HuksOptions) : Promise; /** @@ -280,8 +268,8 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function attestKey(keyAlias: string, options: HuksOptions) : Promise; + function attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function attestKeyItem(keyAlias: string, options: HuksOptions) : Promise; /** * Get the sdk version. @@ -304,6 +292,7 @@ declare namespace huks { /** * Interface of huks handle. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -313,6 +302,16 @@ declare namespace huks { token?: Uint8Array; } + /** + * Interface of huks handle. + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export interface HuksSessionHandle { + handle: number; + token?: Uint8Array; + } + /** * Interface of huks option. * @since 8 @@ -325,6 +324,7 @@ declare namespace huks { /** * Interface of huks result. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -335,8 +335,20 @@ declare namespace huks { certChains?: Array; } + /** + * Interface of huks result. + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export interface HuksReturnResult { + outData?: Uint8Array; + properties?: Array; + certChains?: Array; + } + /** * @name HuksErrorCode + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -460,94 +472,28 @@ declare namespace huks { } /** - * @name HuksErrorCode + * @name HuksExceptionErrCode * @since 9 * @syscap SystemCapability.Security.Huks */ - export enum HuksErrorCodeItem { - HUKS_UNIVERSAL_ERROR_PERMISSION_VERIFY_FAIL = 201, - HUKS_UNIVERSAL_ERROR_PARAM_CHECK_FAIL = 401, - HUKS_UNIVERSAL_ERROR_NOT_SUPPORT_API = 801, - - HUKS_SYSTEMCAPABILITY_ERROR_NUMBER = 12000000, - - HUKS_ERROR_BASE = 1200000, - HUKS_FAILURE = 1200001 , - HUKS_ERROR_BAD_STAT= 12000002, - HUKS_ERROR_INVALID_ARGUMENT= 12000003, - HUKS_ERROR_NOT_SUPPORTED= 12000004, - HUKS_ERROR_NO_PERMISSION= 12000005, - HUKS_ERROR_INSUFFICIENT_DATA= 12000006, - HUKS_ERROR_BUFFER_TOO_SMALL= 12000007, - HUKS_ERROR_INSUFFICIENT_MEMORY= 12000008, - HUKS_ERROR_COMMUNICATION_FAILURE= 12000009, - HUKS_ERROR_STORAGE_FAILURE = 12000010, - HUKS_ERROR_HARDWARE_FAILURE= 12000011, - HUKS_ERROR_ALREADY_EXISTS= 12000012, - HUKS_ERROR_NOT_EXIST= 120000013, - HUKS_ERROR_NULL_POINTER= 12000014, - HUKS_ERROR_FILE_SIZE_FAIL= 12000015, - HUKS_ERROR_READ_FILE_FAIL= 12000016, - HUKS_ERROR_INVALID_PUBLIC_KEY= 12000017, - HUKS_ERROR_INVALID_PRIVATE_KEY= 12000018, - HUKS_ERROR_INVALID_KEY_INFO= 12000019, - HUKS_ERROR_HASH_NOT_EQUAL = 12000020, - HUKS_ERROR_MALLOC_FAIL= 12000021, - HUKS_ERROR_WRITE_FILE_FAIL= 12000022, - HUKS_ERROR_REMOVE_FILE_FAIL= 12000023, - HUKS_ERROR_OPEN_FILE_FAIL= 12000024, - HUKS_ERROR_CLOSE_FILE_FAI= 12000025, - HUKS_ERROR_MAKE_DIR_FAIL= 12000026, - HUKS_ERROR_INVALID_KEY_FILE= 12000027, - HUKS_ERROR_IPC_MSG_FAIL= 12000028, - HUKS_ERROR_REQUEST_OVERFLOWS= 12000029 - HUKS_ERROR_PARAM_NOT_EXIST = 12000030, - HUKS_ERROR_CRYPTO_ENGINE_ERROR= 12000031 - HUKS_ERROR_COMMUNICATION_TIMEOUT= 12000032, - HUKS_ERROR_IPC_INIT_FAIL= 12000033, - HUKS_ERROR_IPC_DLOPEN_FAIL= 12000034, - HUKS_ERROR_EFUSE_READ_FAIL= 12000035, - HUKS_ERROR_NEW_ROOT_KEY_MATERIAL_EXIST= 12000036, - HUKS_ERROR_UPDATE_ROOT_KEY_MATERIAL_FAIL= 12000037, - HUKS_ERROR_VERIFICATION_FAILED= 12000038, - HUKS_ERROR_SESSION_REACHED_LIMIT= 12000039, - HUKS_ERROR_GET_USERIAM_SECINFO_FAILED = 12000040, - HUKS_ERROR_GET_USERIAM_AUTHINFO_FAILED = 12000041, - HUKS_ERROR_USER_AUTH_TYPE_NOT_SUPPORT = 12000042, - HUKS_ERROR_KEY_AUTH_FAILED = 12000043, - HUKS_ERROR_DEVICE_NO_CREDENTIAL = 12000044, - - HUKS_ERROR_CHECK_GET_ALG_FAIL = 12000100, - HUKS_ERROR_CHECK_GET_KEY_SIZE_FAIL = 12000101, - HUKS_ERROR_CHECK_GET_PADDING_FAIL = 12000102, - HUKS_ERROR_CHECK_GET_PURPOSE_FAIL = 12000103, - HUKS_ERROR_CHECK_GET_DIGEST_FAIL = 12000104, - HUKS_ERROR_CHECK_GET_MODE_FAIL = 12000105, - HUKS_ERROR_CHECK_GET_NONCE_FAIL = 12000106, - HUKS_ERROR_CHECK_GET_AAD_FAIL = 12000107, - HUKS_ERROR_CHECK_GET_IV_FAIL = 12000108, - HUKS_ERROR_CHECK_GET_AE_TAG_FAIL = 12000109, - HUKS_ERROR_CHECK_GET_SALT_FAIL = 12000110, - HUKS_ERROR_CHECK_GET_ITERATION_FAIL = 12000111, - HUKS_ERROR_INVALID_ALGORITHM = 12000112, - HUKS_ERROR_INVALID_KEY_SIZE = 12000113, - HUKS_ERROR_INVALID_PADDING = 12000114, - HUKS_ERROR_INVALID_PURPOSE = 12000115, - HUKS_ERROR_INVALID_MODE = 12000116, - HUKS_ERROR_INVALID_DIGEST = 12000117, - HUKS_ERROR_INVALID_SIGNATURE_SIZE = 12000118, - HUKS_ERROR_INVALID_IV = 12000119, - HUKS_ERROR_INVALID_AAD = 12000120, - HUKS_ERROR_INVALID_NONCE = 12000121, - HUKS_ERROR_INVALID_AE_TAG = 12000122, - HUKS_ERROR_INVALID_SALT = 12000123, - HUKS_ERROR_INVALID_ITERATION = 12000124, - HUKS_ERROR_INVALID_OPERATION = 12000125, - HUKS_ERROR_INVALID_WRAPPED_FORMAT = 12000126, - HUKS_ERROR_INVALID_USAGE_OF_KEY = 12000127, - - HUKS_ERROR_INTERNAL_ERROR = 12000999, - HUKS_ERROR_UNKNOWN_ERROR = 12001000, + export enum HuksExceptionErrCode { + HUKS_ERR_CODE_PERMISSION_FAIL = 201, + HUKS_ERR_CODE_ILLEGAL_ARGUMENT = 401, + HUKS_ERR_CODE_NOT_SUPPORTED_API = 801, + + HUKS_ERR_CODE_FEATURE_NOT_SUPPORTED = 12000001, + HUKS_ERR_CODE_MISSING_CRYPTO_ALG_ARGUMENT = 12000002, + HUKS_ERR_CODE_INVALID_CRYPTO_ALG_ARGUMENT = 12000003, + HUKS_ERR_CODE_FILE_OPERATION_FAIL = 12000004, + HUKS_ERR_CODE_COMMUNICATION_FAIL = 12000005, + HUKS_ERR_CODE_CRYPTO_FAIL = 12000006, + HUKS_ERR_CODE_KEY_AUTH_PERMANENTLY_INVALIDATED = 12000007, + HUKS_ERR_CODE_KEY_AUTH_VERIFY_FAILED = 12000008, + HUKS_ERR_CODE_KEY_AUTH_TIME_OUT = 12000009, + HUKS_ERR_CODE_SESSION_LIMIT = 12000010, + HUKS_ERR_CODE_ITEM_NOT_EXIST = 12000011, + HUKS_ERR_CODE_INTERNAL_ERROR = 12000012, + HUKS_ERR_CODE_CREDENTIAL_NOT_EXIST = 12000013, } /** diff --git a/api/@system.cipher.d.ts b/api/@system.cipher.d.ts index 11f0cfb9f5..71e1f6a6ff 100644 --- a/api/@system.cipher.d.ts +++ b/api/@system.cipher.d.ts @@ -194,6 +194,7 @@ export interface CipherAesOptions { export default class Cipher { /** * Encrypts or decrypts data using RSA. + * @Deprecated * @param options RSA options * @syscap SystemCapability.Security.Cipher */ @@ -201,6 +202,7 @@ export default class Cipher { /** * Encrypts or decrypts data using AES. + * @Deprecated * @param options AES options * @syscap SystemCapability.Security.Cipher */ -- Gitee From 2a9a3b21c98edd0b2ad88522a951de7eb0f4154b Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 15:53:45 +0800 Subject: [PATCH 6/9] modify annotation --- api/@ohos.security.huks.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 340447d301..b531badde8 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -204,7 +204,7 @@ declare namespace huks { * Update Operation. * @param {number} handle - Indicates the handle of the init operation. * @param {HuksOptions} options - Indicates the properties of the update operation. - * @param {Uint8Array} token - Indicates the value of token. + * @param {Uint8Array} token - Indicates the value of AuthToken from USER IAM service. * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks * @since 9 @@ -228,7 +228,7 @@ declare namespace huks { * Finish Operation. * @param {number} handle - Indicates the handle of the init operation. * @param {HuksOptions} options - Indicates the properties of the finish operation. - * @param {Uint8Array} token - Indicates the value of token. + * @param {Uint8Array} token - Indicates the value of AuthToken from USER IAM service. * @throws {BusinessError} if the type of params is wrong. * @syscap SystemCapability.Security.Huks * @since 9 @@ -309,7 +309,7 @@ declare namespace huks { */ export interface HuksSessionHandle { handle: number; - token?: Uint8Array; + challenge?: Uint8Array; } /** -- Gitee From d47dd597b73547351a652609bd0e5c11a2306780 Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 16:06:29 +0800 Subject: [PATCH 7/9] fix return type of attestation --- api/@ohos.security.huks.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index b531badde8..414606f606 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -268,8 +268,8 @@ declare namespace huks { * @syscap SystemCapability.Security.Huks * @since 9 */ - function attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; - function attestKeyItem(keyAlias: string, options: HuksOptions) : Promise; + function attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function attestKeyItem(keyAlias: string, options: HuksOptions) : Promise; /** * Get the sdk version. -- Gitee From dea10e8897be3ef7b779f5ee14f959a36ea6c366 Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 17:10:54 +0800 Subject: [PATCH 8/9] [description]: add sign-off-by [sign-off-by]: jinling --- api/@ohos.security.huks.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 414606f606..e0acbb0139 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -304,8 +304,8 @@ declare namespace huks { /** * Interface of huks handle. - * @since 9 * @syscap SystemCapability.Security.Huks + * @since 9 */ export interface HuksSessionHandle { handle: number; @@ -337,8 +337,8 @@ declare namespace huks { /** * Interface of huks result. - * @since 9 * @syscap SystemCapability.Security.Huks + * @since 9 */ export interface HuksReturnResult { outData?: Uint8Array; -- Gitee From 74175202e47a7973c90a9187c67b040a08d2dc9c Mon Sep 17 00:00:00 2001 From: here4thee <11377436+here4thee@user.noreply.gitee.com> Date: Thu, 15 Sep 2022 17:20:36 +0800 Subject: [PATCH 9/9] [description]: add signed-off-by Signed-off-by: jinling --- api/@ohos.security.huks.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index e0acbb0139..414606f606 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -304,8 +304,8 @@ declare namespace huks { /** * Interface of huks handle. - * @syscap SystemCapability.Security.Huks * @since 9 + * @syscap SystemCapability.Security.Huks */ export interface HuksSessionHandle { handle: number; @@ -337,8 +337,8 @@ declare namespace huks { /** * Interface of huks result. - * @syscap SystemCapability.Security.Huks * @since 9 + * @syscap SystemCapability.Security.Huks */ export interface HuksReturnResult { outData?: Uint8Array; -- Gitee