1# Specifying the User for Key Operations (for System Applications Only) 2 3To implement isolation and access control for key data, HUKS provides APIs with the user ID specified for concurrent key operations initiated by multiple users. 4>**NOTE**<br> 5> The mini-system devices do not support the operation described in this topic. 6 7## Constraints 8 9- The range of the caller's user ID is **0** to **99**, including **0** and **99**. 10- The APIs are available only for system applications. 11 12## Available APIs 13 14APIs with the **userId** parameter are provided as enhancement to existing APIs. 15 16When using these APIs, observe the following: 17 181. You can pass in [HUKS_TAG_AUTH_STORAGE_LEVEL](../../reference/apis-universal-keystore-kit/_huks_type_api.md#oh_huks_authstoragelevel) in **options** to specify the security level for the key stored. 192. If **HUKS_TAG_AUTH_STORAGE_LEVEL** is not specified in **options**, the key can be accessed only after the first unlock of the device by default, which is equivalent to passing in [HUKS_AUTH_STORAGE_LEVEL_CE](../../reference/apis-universal-keystore-kit/_huks_type_api.md#oh_huks_authstoragelevel). 20 21The algorithm specifications and the usage of the APIs are the same as those of the APIs without **userId**. 22 23| API with userId| Description| API Without userId| 24| -------- | -------- | ----------| 25| [generateKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksgeneratekeyitemasuser) | Generates a key. | [generateKeyItem](huks-key-generation-arkts.md) | 26| [deleteKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksdeletekeyitemasuser) | Deletes a key. | [deleteKeyItem](huks-delete-key-arkts.md) | 27| [importKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksimportkeyitemasuser) | Imports a key in plaintext. | [importKeyItem](huks-import-key-in-plaintext-arkts.md) | 28| [importWrappedKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksimportwrappedkeyitemasuser) | Imports an encrypted key. | [importWrappedKeyItem](huks-import-wrapped-key-arkts.md) | 29| [exportKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksexportkeyitemasuser) | Exports a key. | [exportKeyItem](huks-export-key-arkts.md) | 30| [getKeyItemPropertiesAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksgetkeyitempropertiesasuser) | Obtains key properties. | [getKeyItemProperties](huks-obtain-key-properties-arkts.md) | 31| [hasKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#hukshaskeyitemasuser) | Checks whether a key exists. | [hasKeyItem](huks-check-key-arkts.md) | 32| [initSessionAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksinitsessionasuser) | Initializes a key session. | initSession in [encryption and decryption](huks-encryption-decryption-arkts.md), [signing and signature verification](huks-signing-signature-verification-arkts.md), [key agreement](huks-key-agreement-arkts.md), and [key derivation](huks-key-derivation-arkts.md) | 33| [attestKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksattestkeyitemasuser) | Performs non-anonymous key attestation. | [attestKeyItem](huks-key-attestation-arkts.md) | 34| [anonAttestKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksanonattestkeyitemasuser) | Performs anonymous key attestation. | [anonAttestKeyItem](huks-key-anon-attestation-arkts.md) | 35