From 3dea5d429154b1cc86eb6c8a80b7b51c04964891 Mon Sep 17 00:00:00 2001 From: code4lala Date: Mon, 5 Feb 2024 20:35:16 +0800 Subject: [PATCH] add huks AsUser Signed-off-by: code4lala --- api/@ohos.security.huks.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 614d453ca..d98bbbbe8 100644 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -107,6 +107,31 @@ declare namespace huks { */ function generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback): void; + /** + * Generate Key As User. + * + * @param { string } keyAlias - keyAlias indicates the key's name. + * @param { HuksOptions } options - options indicates the properties of the key. + * @param { number } userId - userId indicates the userId of the owner of the key. + * @param { AsyncCallback } callback - the callback of generateKeyItem. + * @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.Core + * @atomicservice + * @since 12 + */ + function generateKeyItemAsUser(keyAlias: string, options: HuksOptions, userId: number, callback: AsyncCallback): void; + /** * Generate Key. * -- Gitee