diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 614d453ca15387a358c1f4a3e408764b29595d1b..d98bbbbe87d2e279784d245b5cfafcf85c2ce363 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. *