From 6b4605396cd9924176e22f34a7ca47cfeeffdc67 Mon Sep 17 00:00:00 2001 From: CheungVane Date: Sun, 9 Oct 2022 10:21:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?HUKS=20=E6=94=AF=E6=8C=81api=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86=20Signed-off-by:=20zhangwenzhi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.security.huks.d.ts | 329 ++++++++++++++++++++++++++++++++--- api/@system.cipher.d.ts | 3 + 2 files changed, 306 insertions(+), 26 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index eb00b60114..2e6824e834 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. @@ -31,8 +32,31 @@ 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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000013 - queried credential does not exist + * @throws {BusinessError} 12000014 - memory is insufficient + * @throws {BusinessError} 12000015 - call service failed + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function generateKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Delete Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -41,8 +65,26 @@ 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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function deleteKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function deleteKeyItem(keyAlias: string, options: HuksOptions) : Promise; + /** * Import Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -52,18 +94,55 @@ 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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000013 - queried credential does not exist + * @throws {BusinessError} 12000014 - memory is insufficient + * @throws {BusinessError} 12000015 - call service failed + * @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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000013 - queried credential does not exist + * @throws {BusinessError} 12000014 - memory is insufficient + * @throws {BusinessError} 12000015 - call service failed * @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 importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions) : Promise; /** * Export Key. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -72,8 +151,30 @@ 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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient + * @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. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -82,8 +183,30 @@ 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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient + * @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. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -92,8 +215,28 @@ 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} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function isKeyItemExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function isKeyItemExist(keyAlias: string, options: HuksOptions) : Promise; + /** * Init Operation. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -104,19 +247,31 @@ declare namespace huks { function init(keyAlias: string, options: HuksOptions) : Promise; /** - * Update Operation. - * @since 8 + * Init Operation. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key. + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000010 - the number of sessions has reached limit + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient * @syscap SystemCapability.Security.Huks - * @param handle Indicates the handle of the init operation. - * @param token Indicates the value of token. - * @param options Indicates the properties of the update operation. + * @since 9 */ - function update(handle: number, token?: Uint8Array, options: HuksOptions, callback: AsyncCallback) : void; - function update(handle: number, token?: Uint8Array, options: HuksOptions) : Promise; + function initSession(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function initSession(keyAlias: string, options: HuksOptions) : Promise; /** * Update Operation. - * @since 9 + * @Deprecated + * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. * @param options Indicates the properties of the update operation. @@ -126,8 +281,35 @@ declare namespace huks { function update(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; function update(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 AuthToken from USER IAM service. + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000007 - this credential is already invalidated permanently + * @throws {BusinessError} 12000008 - verify authtoken failed + * @throws {BusinessError} 12000009 - authtoken is already timeout + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient + * @syscap SystemCapability.Security.Huks + * @since 9 + */ + function updateSession(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function updateSession(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function updateSession(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. @@ -138,17 +320,33 @@ declare namespace huks { /** * Finish Operation. - * @since 9 + * @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 AuthToken from USER IAM service. + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000007 - this credential is already invalidated permanently + * @throws {BusinessError} 12000008 - verify authtoken failed + * @throws {BusinessError} 12000009 - authtoken is already timeout + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient * @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 finishSession(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function finishSession(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback) : void; + function finishSession(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. @@ -157,16 +355,44 @@ declare namespace huks { function abort(handle: number, options: HuksOptions, callback: AsyncCallback) : void; function abort(handle: number, options: HuksOptions) : Promise; - /** - * Key Attestation. + * Abort Operation. + * @param {number} handle - Indicates the handle of the init operation. + * @param {HuksOptions} options - Indicates the properties of the abort operation. + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient + * @syscap SystemCapability.Security.Huks * @since 9 + */ + function abortSession(handle: number, options: HuksOptions, callback: AsyncCallback) : void; + function abortSession(handle: number, options: HuksOptions) : Promise; + + /** + * Key Attestation. + * @param {string} keyAlias - Indicates the key's name. + * @param {HuksOptions} options - Indicates the properties of the key attestation operation. + * @throws {BusinessError} 201 - check permission failed + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 801 - api is not supported + * @throws {BusinessError} 12000001 - algorithm mode is not supported + * @throws {BusinessError} 12000002 - algorithm param is missing + * @throws {BusinessError} 12000003 - algorithm param is invalid + * @throws {BusinessError} 12000004 - operating file failed + * @throws {BusinessError} 12000005 - IPC communication failed + * @throws {BusinessError} 12000006 - error occured in crypto engine + * @throws {BusinessError} 12000011 - queried entity does not exist + * @throws {BusinessError} 12000012 - external error + * @throws {BusinessError} 12000014 - memory is insufficient * @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 attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; + function attestKeyItem(keyAlias: string, options: HuksOptions) : Promise; /** * Get the sdk version. @@ -189,6 +415,7 @@ declare namespace huks { /** * Interface of huks handle. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -198,6 +425,16 @@ declare namespace huks { token?: Uint8Array; } + /** + * Interface of huks handle. + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + export interface HuksSessionHandle { + handle: number; + challenge?: Uint8Array; + } + /** * Interface of huks option. * @since 8 @@ -210,6 +447,7 @@ declare namespace huks { /** * Interface of huks result. + * @Deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -220,8 +458,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 */ @@ -344,6 +594,33 @@ declare namespace huks { HUKS_ERROR_UNKNOWN_ERROR = -1000, } + /** + * @name HuksExceptionErrCode + * @since 9 + * @syscap SystemCapability.Security.Huks + */ + 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_EXTERNAL_ERROR = 12000012, + HUKS_ERR_CODE_CREDENTIAL_NOT_EXIST = 12000013, + HUKS_ERR_CODE_INSUFFICIENT_MEMORY = 12000014, + HUKS_ERR_CODE_CALL_SERVICE_FAILED = 12000015, + } + /** * @name HuksKeyPurpose * @since 8 diff --git a/api/@system.cipher.d.ts b/api/@system.cipher.d.ts index 11f0cfb9f5..0a6a344f60 100644 --- a/api/@system.cipher.d.ts +++ b/api/@system.cipher.d.ts @@ -187,6 +187,7 @@ export interface CipherAesOptions { /** * Defines the cipher functions. + * @Deprecated * @since 3 * @syscap SystemCapability.Security.Cipher * @permission N/A @@ -194,6 +195,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 +203,7 @@ export default class Cipher { /** * Encrypts or decrypts data using AES. + * @Deprecated * @param options AES options * @syscap SystemCapability.Security.Cipher */ -- Gitee From 01efe45e65a0e4f6a3ca490c6b19e1ecfb76b12b Mon Sep 17 00:00:00 2001 From: CheungVane Date: Sun, 9 Oct 2022 11:36:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=86=99=20Signed-off-by:=20zhangwenzhi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.security.huks.d.ts | 26 +++++++++++++------------- api/@system.cipher.d.ts | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 2e6824e834..834cf9aff0 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -23,7 +23,7 @@ import {AsyncCallback} from './basic'; declare namespace huks { /** * Generate Key. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -56,7 +56,7 @@ declare namespace huks { /** * Delete Key. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -84,7 +84,7 @@ declare namespace huks { /** * Import Key. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -142,7 +142,7 @@ declare namespace huks { /** * Export Key. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -174,7 +174,7 @@ declare namespace huks { /** * Get properties of the key. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -206,7 +206,7 @@ declare namespace huks { /** * Check whether the key exists. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -236,7 +236,7 @@ declare namespace huks { /** * Init Operation. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. @@ -270,7 +270,7 @@ declare namespace huks { /** * Update Operation. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -309,7 +309,7 @@ declare namespace huks { /** * Finish Operation. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -346,7 +346,7 @@ declare namespace huks { /** * Abort Operation. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. @@ -415,7 +415,7 @@ declare namespace huks { /** * Interface of huks handle. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -447,7 +447,7 @@ declare namespace huks { /** * Interface of huks result. - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ @@ -471,7 +471,7 @@ declare namespace huks { /** * @name HuksErrorCode - * @Deprecated + * @deprecated * @since 8 * @syscap SystemCapability.Security.Huks */ diff --git a/api/@system.cipher.d.ts b/api/@system.cipher.d.ts index 0a6a344f60..39fdf6c2df 100644 --- a/api/@system.cipher.d.ts +++ b/api/@system.cipher.d.ts @@ -187,7 +187,7 @@ export interface CipherAesOptions { /** * Defines the cipher functions. - * @Deprecated + * @deprecated * @since 3 * @syscap SystemCapability.Security.Cipher * @permission N/A @@ -195,7 +195,7 @@ export interface CipherAesOptions { export default class Cipher { /** * Encrypts or decrypts data using RSA. - * @Deprecated + * @deprecated * @param options RSA options * @syscap SystemCapability.Security.Cipher */ @@ -203,7 +203,7 @@ export default class Cipher { /** * Encrypts or decrypts data using AES. - * @Deprecated + * @deprecated * @param options AES options * @syscap SystemCapability.Security.Cipher */ -- Gitee From 7b0254488fc00b10f02269ddf39658c1cf46e719 Mon Sep 17 00:00:00 2001 From: CheungVane Date: Sun, 9 Oct 2022 14:27:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0useinsteadof=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=AD=97=E6=AE=B5=20Signed-off-by:=20zhangwenzhi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.security.huks.d.ts | 39 ++++++++++++++++++++++++------------ api/@system.cipher.d.ts | 7 ++++--- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 834cf9aff0..0846902f60 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -23,8 +23,9 @@ import {AsyncCallback} from './basic'; declare namespace huks { /** * Generate Key. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.generateKeyItem * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -56,8 +57,9 @@ declare namespace huks { /** * Delete Key. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.deleteKeyItem * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -84,8 +86,9 @@ declare namespace huks { /** * Import Key. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.importKeyItem * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -142,8 +145,9 @@ declare namespace huks { /** * Export Key. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.exportKeyItem * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -174,8 +178,9 @@ declare namespace huks { /** * Get properties of the key. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.getKeyItemProperties * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -206,8 +211,9 @@ declare namespace huks { /** * Check whether the key exists. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.isKeyItemExist * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -236,8 +242,9 @@ declare namespace huks { /** * Init Operation. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.initSession * @syscap SystemCapability.Security.Huks * @param keyAlias Indicates the key's name. * @param options Indicates the properties of the key. @@ -270,8 +277,9 @@ declare namespace huks { /** * Update Operation. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.updateSession * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. * @param options Indicates the properties of the update operation. @@ -309,8 +317,9 @@ declare namespace huks { /** * Finish Operation. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.finishSession * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. * @param options Indicates the properties of the finish operation. @@ -346,8 +355,9 @@ declare namespace huks { /** * Abort Operation. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.abortSession * @syscap SystemCapability.Security.Huks * @param handle Indicates the handle of the init operation. * @param options Indicates the properties of the abort operation. @@ -415,8 +425,9 @@ declare namespace huks { /** * Interface of huks handle. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.HuksSessionHandle * @syscap SystemCapability.Security.Huks */ export interface HuksHandle { @@ -447,8 +458,9 @@ declare namespace huks { /** * Interface of huks result. - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.HuksReturnResult * @syscap SystemCapability.Security.Huks */ export interface HuksResult { @@ -471,8 +483,9 @@ declare namespace huks { /** * @name HuksErrorCode - * @deprecated * @since 8 + * @deprecated since 9 + * @useinstead ohos.security.huks.HuksExceptionErrCode * @syscap SystemCapability.Security.Huks */ export enum HuksErrorCode { diff --git a/api/@system.cipher.d.ts b/api/@system.cipher.d.ts index 39fdf6c2df..a22cffdfae 100644 --- a/api/@system.cipher.d.ts +++ b/api/@system.cipher.d.ts @@ -187,15 +187,16 @@ export interface CipherAesOptions { /** * Defines the cipher functions. - * @deprecated * @since 3 + * @deprecated since 9 + * @useinstead ohos.security.cryptoFramework.Cipher * @syscap SystemCapability.Security.Cipher * @permission N/A */ export default class Cipher { /** * Encrypts or decrypts data using RSA. - * @deprecated + * @deprecated since 9 * @param options RSA options * @syscap SystemCapability.Security.Cipher */ @@ -203,7 +204,7 @@ export default class Cipher { /** * Encrypts or decrypts data using AES. - * @deprecated + * @deprecated since 9 * @param options AES options * @syscap SystemCapability.Security.Cipher */ -- Gitee