1e41f4b71Sopenharmony_ci# Specifying the User for Key Operations (for System Applications Only) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciTo implement isolation and access control for key data, HUKS provides APIs with the user ID specified for concurrent key operations initiated by multiple users. 4e41f4b71Sopenharmony_ci>**NOTE**<br> 5e41f4b71Sopenharmony_ci> The mini-system devices do not support the operation described in this topic. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci## Constraints 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci- The value range of the user ID is **0** to **99**, including **0** and **99**. 10e41f4b71Sopenharmony_ci- The APIs are available only for system applications. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci## Available APIs 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ciAPIs with the **userId** parameter are provided as enhancement to existing APIs. 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ciWhen using these APIs, observe the following: 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci1. 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. 19e41f4b71Sopenharmony_ci2. 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). 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciThe algorithm specifications and the usage of the APIs are the same as those of the APIs without **userId**. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci| API with userId| Description| API Without userId| 24e41f4b71Sopenharmony_ci| -------- | -------- | ----------| 25e41f4b71Sopenharmony_ci| [generateKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksgeneratekeyitemasuser) | Generates a key. | [generateKeyItem](huks-key-generation-arkts.md) | 26e41f4b71Sopenharmony_ci| [deleteKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksdeletekeyitemasuser) | Deletes a key. | [deleteKeyItem](huks-delete-key-arkts.md) | 27e41f4b71Sopenharmony_ci| [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) | 28e41f4b71Sopenharmony_ci| [importWrappedKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksimportwrappedkeyitemasuser) | Imports an encrypted key. | [importWrappedKeyItem](huks-import-wrapped-key-arkts.md) | 29e41f4b71Sopenharmony_ci| [exportKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksexportkeyitemasuser) | Exports a key. | [exportKeyItem](huks-export-key-arkts.md) | 30e41f4b71Sopenharmony_ci| [getKeyItemPropertiesAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksgetkeyitempropertiesasuser) | Obtains key properties. | [getKeyItemProperties](huks-obtain-key-properties-arkts.md) | 31e41f4b71Sopenharmony_ci| [hasKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#hukshaskeyitemasuser) | Checks whether a key exists. | [hasKeyItem](huks-check-key-arkts.md) | 32e41f4b71Sopenharmony_ci| [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) | 33e41f4b71Sopenharmony_ci| [attestKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksattestkeyitemasuser) | Performs non-anonymous key attestation. | [attestKeyItem](huks-key-attestation-arkts.md) | 34e41f4b71Sopenharmony_ci| [anonAttestKeyItemAsUser](../../reference/apis-universal-keystore-kit/js-apis-huks-sys.md#huksanonattestkeyitemasuser) | Performs anonymous key attestation. | [anonAttestKeyItem](huks-key-anon-attestation-arkts.md) | 35